Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface WebHooks

Hierarchy

Index

Properties

Optional filters

filters: WebhookFilter[]

Webhook filters

headers

headers: Array<WebhookHeader>

Headers that should be appended to the webhook request

Optional httpBasicPassword

httpBasicPassword: undefined | string

Password for basic http auth

Optional httpBasicUsername

httpBasicUsername: undefined | 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

getCalls

getHealth

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)