Configuring a View My Sensors Webhook

You can have your data displayed in View My Sensors as well as pushed to your own database. This is done by coding the data into a URL query, then sending the data via HTTP get request at the time data is received. There is an extensive list of parameters that can be passed, allowing you to send detailed information about both the data and the sensor.

Setting up a Webhook

  • Open View My Sensors
  • Navigate to “API”
  • Select the link for API / Webhook
  • The API Information page will open

Tab Layout

The Tab Bar across the top will read as follows:

Webhook API Tab (as highlighted)  Here you can find information on Data Push, General Output Format, Gateway Parameters, and Sensor Parameters.

History tab displays the history of your data pushes. A Data Push sends data to your endpoint when data is received at the server. You can configure the destination and query parameters used to route the request. Data is compiled as a JSON body and sent via HTTP POST. There are four (4) endpoints available now. Webhook, Amazon AWS, Microsoft Azure IoT Hub, and IBM Watson. Only one (1) data push is allowed per account. If no data push has been configured, this page will be blank.

C. Depending on if you have an existing data push or not the Configure Webhook tab will allow you to edit and save or delete your previously entered information.

D. The Notification Tab covers data push settings that allow you to customize when and to whom emails are sent when your External Data Push fails multiple times in a row. You will only be notified once every 24 hours unless your data push failures exceed 100, in which case you will be notified of your data push being disabled.

Creating a Webhook

  • Select the Configure Webhook
  • Open the dropdown menu on the Create Data Type page. Select “Webhook.”
  • A webhook sends data to your application when data is received at the server. You can configure the URL, Headers, Cookies, and query parameters used to route the request. Headers and cookies will be available to add after saving your connection string. Data is compiled as a JSON body and sent via HTTP POST.

  • Base URL: This is the location you want to send the DataPush
  • Send gateway message: This is where you decide if you want ALL gateway messages sent to you or only messages that contain a message from your sensor
  • Authentication: Choose “Basic” or “None” to add authentication to your webhook. Selecting “Basic” will ask for the username and password combination to grant access to the webhook.
  • Save your configuration

Note that the tab that used to read “Create” now reads “Edit.” The new data push must be ended for the Create option to be displayed again.

Congratulations! You’ve created a Webhook

----

For additional information regarding this functionality, contact support

----

Posted in MSGO3A, Software, Support Center, ViewMySensors.