Retrieve AHJ name
This tutorial shows how to automatically retrieve the name of the Authority Having Jurisdiction (AHJ) for a project.
How It Works
On project creation, Aurora looks up the AHJ which contains the project’s property address according to the US Census TIGER/Line Legal Boundary Shapefiles. The AHJ assignment happens asynchronously so the AHJ may still be null
immediately after project creation. To be notified when the AHJ assignment is complete, you can subscribe to the ahj_lookup_completed
webhook event.
Getting Started
To complete this tutorial, you will need:
- your Aurora tenant to be on the Custom or Business plan,
- 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 ahj_lookup_completed webhook event.
Subscribe toahj_lookup_completed
webhook event using the Webhooks dashboard or Webhooks API, pointing webhooks to your application that will process them.
//POST <https://api-sandbox.aurorasolar.com/tenants/{tenant_id}/webhooks>
{
"webhook": {
"description": "AHJ lookup complete webhook",
"event": "ahj_lookup_completed",
"url_template": "<https://www.yourcomany.com/asset_created_webhooks?project_id=<PROJECT_ID>&ahj_id=><AHJ_ID>&status=<STATUS>"
"enabled": true
}
}
Step 2. On project creation, Aurora looks up AHJ and sends a webhook after the lookup is complete.
//Webhook query string payload
?project_id=2v52d42f-7b03-40f4-94be-e393ed8c5386&ahj_id=3fa85f64-5717-4562-b3fc-2c963f66afa6&status=succeeded
Step 3. Look up the AHJ name and store it in your target system.
On webhook receipt, use ahj_id
included in the webhook payload to look up the AHJ name via Retrieve AHJ API.
//GET <https://api-sandbox.aurorasolar.com/tenants/{tenant_id}/ahjs/{ahj_id}
//HTTP 200 response
{
"ahj": {
"id": "9bb99768-01a6-4b83-9fad-468b33142132",
"name": "Tuscaloosa city"
}
}
Construct and store in your target system a deep link to the AHJ details in Aurora.
<https://v2.aurorasolar.com/database/operations/ahj/[ahj_id]
>
Considerations
- It’s not uncommon for AHJ lookup to take 10 seconds or more.
- At the moment, Aurora only looks up AHJs for project sites with street addresses. So, AHJ lookup for a project with “Tuscaloosa, AL” as the address will complete with status
failed
. - Consider using a webhook test site like https://webhook.site to verify that your webhook subscription is live.
Updated over 1 year ago