Tutorials

Retrieve auto-saved design screenshot

This tutorial shows how to retrieve design screenshots automatically generated by Aurora.

How It Works


Aurora saves design screenshots on select in-app actions. On asset_created for asset_type CAD Auto Screenshot webhook receipt, retrieve the file using Retrieve Asset API.

Getting Started


To complete this tutorial, you will need:

  • your Aurora tenant to be on the Custom or Business plan,
  • your Aurora tenant to have auto-saved design screenshots enabled,
  • your Aurora tenant to use the current API version,
  • your Aurora bearer token,
  • your Aurora tenant_id,
  • URL to deliver Aurora webhooks to.

You or any Administrator for your Aurora tenant can retrieve the token and tenant id from the API Settings page.

Step 1. Subscribe to asset_created webhook event.


Subscribe toasset_created webhook event with “CAD Auto Screenshot” filter, pointing webhooks to your application that will process them. See Webhooks for more details.

Untitled

Step 2. On select in-app actions, Aurora will auto-save the screenshot and send you a webhook.


Actions that trigger design auto-saves:

  • using the 'Save' keyboard shortcut in Design Mode,
  • running irradiance analysis in Design Mode,
  • running performance simulation in Design Mode,
  • running irradiance analysis in Sales Mode,
  • clicking 'Simulate System' or 'Finalize' buttons on System Design page in Sales Mode.

Step 3. Look up the URL for the newly generated asset and store it in your target system.


On the webhook receipt, look up url byasset_id using Retrieve Asset API. You will use url to download the asset.

//Webhook query string payload
?design_id=2v52d42f-7b03-40f4-94be-e393ed8c5386&asset_id=3fa85f64-5717-4562-b3fc-2c963f66afa6

//GET <https://api-sandbox.aurorasolar.com/tenants/{tenant_id}/assets/{asset_id}>

//HTTP 200 response
{
    "asset": {
        "asset_type": "CAD Auto Screenshot",
        "design_id": "0167f6e1-1472-4d64-a2e1-d10db7d87948",
        "id": "02932942-52dd-4162-8df7-7e2d197f2a81",
        "options": {},
        "project_id": "5083a3a2-e008-4e94-b4e0-064f4177ae35",
        "taken_at": "2023-04-12 14:00:57 UTC",
        "tenant_id": "5da17db9-9b26-4060-8583-7c3961488018",
        "url": "<https://service.bss-prod.auslr.io/api/blob/249f41ae2a22dc5dcf69c82a8567c886?token=8ea2943f33933ce8b91b02ac260e57d6>",
        "user_id": "a6447eab-38ae-40c4-8b43-c218e9e67b11"
    }
}

Considerations


  • Auto-saved design screenshots are not available in the legacy Aurora..
  • Auto-saving screenshots is silent. Your users won’t see any indication (e.g., a toast in CAD window) that the screenshot is being saved.
  • Only the most recent auto-saved screenshot is stored. And Aurora doesn’t keep history of previously auto-saved screenshots. To keep the history, consider storing the screenshots in your system before the next screenshot is saved.
  • Consider using a webhook test site like https://webhook.site to verify that your webhook subscription is live.