Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Properties

active

active: boolean

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

Optional filters

filters?: WebhookFilter[]

Webhook filters

headers

headers: WebhookHeader[]

Headers that should be appended to the webhook request

Optional httpBasicPassword

httpBasicPassword?: string

Password for basic http auth

Optional httpBasicUsername

httpBasicUsername?: string

Username for basic http auth

name

name: string

Webhook name

sys

sys: BasicMetaSysProps & { space: SysLink }

System metadata

topics

topics: string[]

Topics the webhook wants to subscribe to

Optional transformation

transformation?: WebhookTransformation

Transformation to apply

url

url: string

Webhook url

Methods

delete

  • delete(): Promise<void>
  • Deletes this object on the server.

    Returns Promise<void>

    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)

getCall

  • getCall(id: string): Promise<WebhookCallDetailsProps>

getCalls

  • getCalls(): Promise<CollectionProp<Except<WebhookCallDetailsProps, "request" | "response">>>

getHealth

  • getHealth(): Promise<WebhookHealthProps>

toPlainObject

update

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

    Returns Promise<WebHooks>

    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)