Hierarchy

Properties

active: boolean

Whether the Webhook is active. If set to false, no calls will be made

filters?: WebhookFilter[]

Webhook filters

headers: WebhookHeader[]

Headers that should be appended to the webhook request

httpBasicPassword?: string

Password for basic http auth

httpBasicUsername?: string

Username for basic http auth

name: string

Webhook name

sys: BasicMetaSysProps & {
    space: SysLink;
}

System metadata

topics: string[]

Topics the webhook wants to subscribe to

transformation?: WebhookTransformation

Transformation to apply

url: string

Webhook url

Methods

  • Deletes this object on the server.

    Returns

    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)

    Returns Promise<void>

  • Sends an update to the server with any changes made to the object's properties

    Returns

    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)

    Returns Promise<WebHooks>