Skip to content

Latest commit

 

History

History
57 lines (44 loc) · 2.43 KB

webhooks.md

File metadata and controls

57 lines (44 loc) · 2.43 KB

Webhooks

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.

Methods

  • list([options])
    Lists all webhooks.

    • options.timezone - the timezone to use for the last_successful and last_failure properties | Default: UTC
  • get(id[, options])
    Get a single webhook by ID.

    • id - the id of the webhook to get required
    • options.timezone - the timezone to use for the last_successful and last_failure properties | Default: UTC
  • create(webhook)
    Create a new webhook.

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 required
    • webhook - 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 required
    • options.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 required
    • options.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.