Creating a Webhook Subscription

Creating a Webhook Subscription

This section describes how to create a webhooks subscription via the Zebra Developer Portal for the purpose of capturing temperature excursion events.
You must provide a server with an HTTPS-capable static endpoint to receive data from Zebra. The endpoint must:
It is recommended that webhooks are created after the task is created but before sensors are associated with the task, otherwise an alarm may occur before the webhook has been created. If that occurs, the webhook notification will not be received.
  • Accept POST requests. Zebra sends customer data to the endpoint you designate in POST requests.
  • Acccept JSON data. Zebra sends data in JSON form. The application/json content-type will deliver the JSON payload directly as the body of the POST request.
  • Use HTTPS. Zebra transmits potentially sensitive data on behalf of customers, and HTTPS is the first step in ensuring their data stays safe.
Prerequisites
  • Create a webhook endpoint within your application(s)
  • Add logic to handle Zebra events. For [PLATFORM or SERVICE] subscriptions, these include: [TEMP DATA]
  • Test your webhook endpoint to confirm that it's working as expected
  1. Ensure your application key for usage of this API is available. See the Getting Started Guide for more details.
  2. Create a POST request to api.zebra.com/v2/devices/environmental-sensors/event/subscription with a body like the following example. Be sure to use your own Client Key, tenant, webhookUrl and the name of your subscription.
  3. Your cURL should look similar to the following example.
  4. You will receive a 200 OK response similar to the following example. By default, the webhook subscription starts immediately after its creation.
    Using the GET method on the same API endpoint, you can confirm your webhook subscription by performing a GET request to return all your subscriptions.