Webhooks send event data from When I Work to an endpoint that you set up letting you know about certain changes that happen in near real-time within your account. Webhooks also allow for a push model where you are notified about any changes made on the backend.
The Endpoint is the URL where When I Work sends the event updates. Event data is sent encrypted and requires an endpoint that supports Transport Layer Security (TLS).
Each payload has a signed hash in the headers using the HMAC-256 hashing algorithm. Use this secret to verify that the payload you have received at your endpoint came from When I Work and not from another source.
Event subscriptions refer to the types of events that are sent to your account. Each event may have several sub-types, but currently only the primary type can be selected for a subscription.
Example (Users sub events)
Hover over , then select General Settings.
- Click Webhooks in the menu on the left.
- Click Enable Webhooks.
- Enter your webserver info into the Endpoint URL field.
- Select the event subscriptions you want sent to your endpoint (webserver).
- Click Save. A Signing Secret field appears and the secret is generated.
Batching is used to group large numbers of events that are generated together into a single payload. Batching is done to prevent making too many requests to your endpoint. Event batching introduces a small delay between when the event is generated and when it is sent to your endpoint. The delay is usually between 5 – 7 seconds. There is no guarantee events are sent in order, but the event data includes a timestamp of when the event was triggered.
If When I Work failed to receive a 2xx response from your endpoint the webhook call is retried. An exponential backoff algorithm is used and retries to deliver the event data happens for about 2 hours before stopping event delivery.