We have now launched our support for custom WebHooks.
The initial set of webhook events are:
- Employee created
- Employee terminated
- Pay run created
- Pay run deleted
- Leave request created
Listing web hook filters
This endpoint will return a list of available web hook filters. Please note that it is permitted to pass ‘*’ to subscribe to all events.
POST /api/v2/business/{businessid}/webhookfilters
Web Hook Registrations
To retrieve the list of current webhook registrations for the business:
# Request
GET api/v2/business/{businessid}/webhookregistrations
# Reply
[
{
"id": "ae5405296e6a4946bb9cc279de0f22f5",
"webHookUri": "http://requestb.in/123aa21e3",
"secret": "111111111122222222223333333333444444",
"description": "My Web Hook",
"isPaused": false,
"filters": [
"*"
],
"headers": {},
"properties": {}
}
]
To register a webhook
POST api/v2/business/{businessid}/webhookregistrations
{
"webHookUri": "http://requestb.in/123aa21e3",
"secret": "111111111122222222223333333333444444",
"description": "My Web Hook",
"filters": [
"*"
],
"headers": {},
"properties": {}
}
Web Hook Properties:
- WebHookUri: the URI to post to for webhook events
- Secret: this will be used to sign the message when the webhook data is POSTed. This can be verified against the Ms-Signature header
- Description: a readable description of the webhook
- Filters: an array of filter names (see above for retrieving a list of filters). This field is optional and, if not specified, will default to ‘all’
- Headers: custom HTTP headers to pass along when the webhook data is POSted
- Properties: custom properties to include in the data webhook data is POSted
To delete a webhook
DELETE api/v2/business/{businessid}/webhookregistrations/{webhookid}
To delete all webhooks for this business
DELETE api/v2/business/{businessid}/webhookregistrations