Webhooks
We provide webhooks for your SmartCoop devices which gives you an efficient way to stay updated with new data or changes without constant polling.Creating a Webhook
- Log in to your account.
- Navigate to "Manage Webhooks" and click the "Create" button.
- Provide a URL to receive the events.
- Use the multi-select box to pick the events you would like to subscribe to.
- Provide a token to authorize the request. You can either create and use a custom token or use our API to generate an authentication key. This ensures that only requests from our service are processed.
Webhook Payload
When one of the events you subscribe to is triggered, your endpoint will receive a HTTP POST with the following shaped payload:
{
"deviceId": "1234567",
"parameterName": "Door Open State",
"oldValue": "closed",
"newValue": "open"
}
Viewing events
From the webhook management screen you can click the "View" button for a single webhook. This screen will show you every event that has been sent to your webhook.
Re-enabling Broken Webhooks
If there is an issue with sending updates to any of your webhooks, we will attempt to notify you up to 5 times. If the issue persists, you will receive an email informing you that the webhook is failing.
To resolve this:
- Log in to the developer console.
- Navigate to "Manage Webhooks."
- Select your endpoint and locate the specific event that was failing on the following screen.
- Details of the error we received will be displayed in the table.
- Once you've fixed the issue, click the "Enable" button, and we will start sending updates again.