Create Webhooks from the API
Follow these instructions to use a POST command to set up a new webhook.
Use a POST to configure a webhook and to enable topics.
In your API call, be aware of the configuration hierarchy and the different topics that are available for organizations and sites.
-
In the API function, be sure to specify the organization ID or site ID. See Configure Webhooks from the API.
-
In the
topicsline, be sure to specify only the topics that are appropriate for the organization or site level. See Webhook Topics.
Here is an example of a POST to configure a site webhook to enable
site-level topics:
See Create Site Webhook for the example
POST structure. Also see Create Org Webhook if applicable. A sample response is
provided below.
{
"name": "analytic",
"type": "http-post",
"url": "https://username:password@hooks.abc.com/uri/...",
"secret": "secret",
"headers":{
"x-custom-1": "your_custom_header_value1",
"x-custom-2": "your_custom_header_value2"
},
"verify_cert": false,
"enabled": true,
"topics": [ "location", "zone", "vbeacon", "rssizone", "asset-raw-rssi", "device-events", "alarms", "audits", "client-join", "client-sessions", "device-updowns", "occupancy-alerts", "mxedge-events", "nac-accounting", "sdkclient-scan-data",]
}
When reusing code blocks, replace placeholder values with actual values, such as your API token, organization ID, site ID, AP name, and so on.
|
Parameter |
Description |
|---|---|
|
name |
The name of the configured webhook. |
|
type |
The type of webhook (http-post, splunk, etc). |
|
url |
The destination to receive the webhook. |
|
secret |
When using the |
|
headers |
Custom headers can be added under the |
|
verify_cert |
Whether or not certificate verification is turned on. True or False. |
|
enabled |
Whether or not the webhook is enabled. True or False. |
|
topics |
The selected items you want receive messages or alerts for. To learn more, see Webhook Topics. Also see the Mist API Reference's Webhook Topics. |
Also see Securing Webhooks with splunk type.