Headers that should be appended to the webhook request
Password for basic http auth
Username for basic http auth
Webhook name
System metadata
Topics the webhook wants to subscribe to
Transformation to apply
Webhook url
Deletes this object on the server.
Promise for the deletion. It contains no data, but the Promise error case should be handled.
const contentful = require('contentful-management')
const client = contentful.createClient({
accessToken: '<content_management_api_key>'
})
client.getSpace('<space_id>')
.then((space) => space.getWebhook('<webhook_id>'))
.then((webhook) => webhook.delete())
.then((webhook) => console.log(`webhook ${webhook.sys.id} updated.`))
.catch(console.error)
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
Promise for call details
const contentful = require('contentful-management')
const client = contentful.createClient({
accessToken: '<content_management_api_key>'
})
client.getSpace('<space_id>')
.then((space) => space.getWebhook('<webhook_id>'))
.then((webhook) => webhook.getCall('<call-id>'))
.then((webhookCall) => console.log(webhookCall))
.catch(console.error)
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.
Promise for list of calls
const contentful = require('contentful-management')
const client = contentful.createClient({
accessToken: '<content_management_api_key>'
})
client.getSpace('<space_id>')
.then((space) => space.getWebhook('<webhook_id>'))
.then((webhook) => webhook.getCalls())
.then((response) => console.log(response.items)) // webhook calls
.catch(console.error)
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.
Promise for health info
const contentful = require('contentful-management')
const client = contentful.createClient({
accessToken: '<content_management_api_key>'
})
client.getSpace('<space_id>')
.then((space) => space.getWebhook('<webhook_id>'))
.then((webhook) => webhook.getHealth())
.then((webhookHealth) => console.log(webhookHealth))
.catch(console.error)
Sends an update to the server with any changes made to the object's properties
Object returned from the server with updated changes.
const contentful = require('contentful-management')
const client = contentful.createClient({
accessToken: '<content_management_api_key>'
})
client.getSpace('<space_id>')
.then((space) => space.getWebhook('<webhook_id>'))
.then((webhook) => {
webhook.name = 'new webhook name'
return webhook.update()
})
.then((webhook) => console.log(`webhook ${webhook.sys.id} updated.`))
.catch(console.error)
Webhook filters