Namespace: Webhook

Webhook

Webhook instances

Type Definitions

Webhook #

Properties:
Name Type Description
sys Meta.Sys System metadata
name string
url string Url which the webhook will call
httpBasicUsername string Username for basic HTTP authentication
httpBasicPassword string Password for basic HTTP authentication
headers object Key value pairs of additional headers to be sent with every webhook call.
topics array Topics which this webhook should be subscribed to. See https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhooks/create-a-webhook for more details
toPlainObject() function Returns this Webhook as a plain JS object
Source:

WebhookCollection #

Properties:
Name Type Description
total number
skip number
limit number
items Array.<Webhook.Webhook>
toPlainObject() function Returns this Webhook collection as a plain JS object
Source:

Methods

(static) delete() → {Promise} #

Deletes this object on the server.
Returns:
Promise for the deletion. It contains no data, but the Promise error case should be handled.
Type:
Promise
Source:
Example
webhook.delete()
.catch(err => console.log(err))

(static) getCalls() → {Promise.<object>} #

List of the most recent webhook calls. See https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhook-calls/webhook-call-overviews for more details.
Returns:
Promise for list of calls
Type:
Promise.<object>
Source:
Example
webhook.getCalls()
.then(calls => console.log(calls.items))

(static) getCalls() → {Promise.<object>} #

Webhook call with specific id. See https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhook-calls/webhook-call-overviews for more details
Returns:
Promise for call details
Type:
Promise.<object>
Source:
Example
webhook.getCall('kjsdk1jeasd')
.then(call => console.log(call))

(static) getHealth() → {Promise.<object>} #

Overview of the health of webhook calls. See https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhook-calls/webhook-call-overviews for more details.
Returns:
Promise for health info
Type:
Promise.<object>
Source:
Example
webhook.getHealth()
.then(health => console.log(health))

(static) update() → {Promise.<Webhook>} #

Sends an update to the server with any changes made to the object's properties
Returns:
Object returned from the server with updated changes.
Type:
Promise.<Webhook>
Source:
Example
webhook.name = 'New name'
webhook.update()
.then(webhook => console.log(webhook.name))