Choose your language:
    Retrieve a webhook
    Returns
    Returns a webhook object.

    Examples

    Example code:
    const SiteClient = require('datocms-client').SiteClient;
    const client = new SiteClient('YOUR-API-TOKEN');
    const webhookId = '312';
    client.webhook.find(webhookId)
    .then((webhook) => {
    console.log(webhook);
    })
    .catch((error) => {
    console.error(error);
    });
    Returned output:
    > node example.js
    {
    "id": "312",
    "name": "Item type creation/update",
    "enabled": true,
    "url": "https://www.example.com/webhook",
    "customPayload": "{ message: 'Successfully published record!' }",
    "httpBasicUser": "user",
    "httpBasicPassword": "password",
    "headers": {
    "xFoo": "Bar"
    },
    "events": [
    {
    "entityType": "item_type",
    "eventTypes": [
    "update",
    "create"
    ],
    "filter": {
    "entityType": "item_type",
    "entityIds": [
    "42",
    "43"
    ]
    }
    }
    ],
    "payloadApiVersion": "3",
    "nestedItemsInPayload": true
    }