Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Configure Zone Entry and Exit Events (Use Case)

Webhooks are one-way messages from a source server or application to a destination server or application. The webhooks methodology is “fire and forget,” meaning that you use webhooks primarily to schedule event-driven messages for alerting and monitoring. In a Juniper Mist network, you can use webhooks to send messages based on Organization or Site topics. This means that you use webhooks primarily to schedule event-driven messages for alerting and monitoring.

For this use case, from the Juniper Mist API, you set up a webhook notification whenever a device enters or exits a zone. This notification is useful for a site with building automation. A user who enters or leaves a defined zone in Juniper Mist (such as a room) and has a tracked device in hand can trigger an event that is sent from Juniper Mist to the building automation system to turn the lights on or off. To learn more about location zones, see Add Location Zones to a Floorplan.

To set up webhooks in the Juniper Mist portal, you need the following configuration items (and may want to use the listed optional item as well):

  • Name for the webhook instance (required)

  • URL (destination to receive the Juniper Mist webhooks (required)

  • Streaming API in the Site Webhooks section (select the “Zone Entry/Exit Events” topic to stream to the destination) (required)

  • Secret, like a password, to authenticate communication from Juniper Mist to the webhook destination (optional)

After you have this information, you can configure the webhook in the Site Settings

  1. From the left menu of the Juniper Mist portal, select Organization > Site Configuration.
  2. Click Add Webhook, enter the information, and click Add.
    For more information about the fields to complete, see Add a Webhook in the Juniper Mist Portal.

    Anytime a device enters or exits a zone, Juniper Mist will create a webhook POST to the specified URL. The incoming request payload, as formatted in JavaScript Object Notation (JSON), looks like this:

    Using this information, you can activate other automations in a third-party system, such as turning off the lights in zone 33294994-6a5f-4804-xxxx-xxxxxxxxxxxx based on the trigger of exit.