This library provides easy access to the Webhooks Resource.
Note: All methods return promises and accept an optional last argument callback. Read about how we handle callbacks and promises.
-
list([options])
Lists all webhooks.options.timezone
- the timezone to use for thelast_successful
andlast_failure
properties | Default:UTC
-
get(id[, options])
Get a single webhook by ID.id
- the id of the webhook to get requiredoptions.timezone
- the timezone to use for thelast_successful
andlast_failure
properties | Default:UTC
-
create(webhook)
Create a new webhook.webhook
- a hash of webhook attributes required
client.webhooks.all() .then(data => { console.log('Congrats you can use our client library!'); console.log(data); }) .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); });
-
update(id, webhook)
Update an existing webhook.id
- the id of the webhook to update requiredwebhook
- a hash of webhook attributes required
-
delete(id)
Delete an existing webhook.id
- the id of the webhook to delete required
-
validate(id, options)
Sends an example message event batch from the Webhook API to the target URL.id
- the id of the webhook to validate requiredoptions.message
- the message (payload) to send to the webhook consumer required
-
getBatchStatus(id[, options])
Gets recent status information about a webhook.id
- the id of the webhook requiredoptions.limit
- maximum number of results to return | Default:1000
-
getDocumentation()
Lists descriptions of the events, event types, and event fields that could be included in a webhooks post to your target URL. -
getSamples(options)
Lists examples of the event data that will be posted to a webhook consumer.options.events
- event types for which to get a sample payload | Default: all event types returned
Visit our examples section to see all of our webhooks resource examples.