Configure Webhooks from the API
Start getting familiar with configuring webhooks with the API.
You can configure webhooks from the API, rather than using the Juniper Mist portal.
For more information about the API, go to these resources:
-
RESTful API Overview (in this guide)
When configuring webhooks, always be aware of the configuration hierarchy.
-
In an organization-level webhook, specify the organization ID:
/api/v1/orgs/{org-id}/webhooksNote:To find the {org-id}, select Organization > Settings from the left menu of the Juniper Mist portal. The organization ID appears near the top of the Organization Settings page.
-
In a site-level webhook, specify the site ID:
/api/v1/sites/{site-id}/webhooksNote:To find the {site-id}, select Organization > Site Configuration from the left menu of the Juniper Mist portal. Then select the site. The site ID appears near the top of the site Configuration page.
Example: Site Configuration
The following function displays all the webhooks configured for a specific site:
/api/v1/sites/4ac1dcf4-9d8b-7211-xxxx-xxxxxxxxxxxx/webhooks
The following output is the result of the previous API call:
HTTP 200 OK
Allow: POST, OPTIONS, GET
Content-Type: application/vnd.api+json
Vary: Accept
[
{
"name": "Lobby-Zone-Events",
"url": "https://webhook.site/02747ddc-2b1f-4134-a1eb-xxxxxxxxxxxx",
"secret": "",
"enabled": true,
"topics": "zone",
"verify_cert": true,
"id": "20538707-b873-4a60-xxxx-xxxxxxxxxxxx",
"for_site": true,
"site_id": "4ac1dcf4-9d8b-7211-xxxx-xxxxxxxxxxxx",
"org_id": "3f12cb79-fb5e-4d4b-xxxx-xxxxxxxxxxxx",
"created_time": 1686252096,
"modified_time": 1686252096
}
]