Build your bot using ChatBot API

API Version

Webhooks

Webhooks, also called a web callback or HTTP push API, are the API concepts that are getting more and more popular. Thanks to their lightweight and speed they provide data between applications immediately. With webhooks, you can pass and retrieve information from a matched interaction to your web service.

List all Webhooks

Returns list of all created webhooks.

GET https://api.chatbot.com/webhooks

Properties

Property Type Description
id String Webhook id.
name String Webhook name.
url String Webhook public url.
error String Last noted error with your webhook.

Request URL

curl --request GET \
	--url https://api.chatbot.com/webhooks \
	--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}'

Response Example

[
    {
        "id": "5a21a9e21ec94a0007f9ac19",
        "name": "Webhook",
        "url": "https://example.com",
        "error": ""
    }
]

Get a specific webhook

Returns a specific webhook object.

GET https://api.chatbot.com/webhooks/:ID

Request URL

curl --request GET \
	--url https://api.chatbot.com/webhooks/:ID \
	--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}'

Response Example

{
    "id": "5a21a9e21ec94a0007f9ac19",
    "name": "Webhook example",
    "url": "https://example.com",
    "token": "qwerty",
    "headers": [],
    "auth": {
        "username": "",
        "password": ""
    },
    "error": {
        "date": "2017-12-04T15:06:12.053Z",
        "message": "timeout of 10000ms exceeded"
    }
}

Properties

Property Type Description
id String Webhook id.
name String Webhook name.
url String Webhook url. Must be public url.
token String Token which can be used to verify incoming webhooks.
headers Array.<Object> Array of objects which includes request headers.
auth Object Object for basic auth authorization.
error Object Error object which includes information about last occured error.

Create a webhook

Creates a new webhook.

curl --request POST \
	--url https://api.chatbot.com/webhooks \
	--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}' \
	--header 'content-type: application/json' \
	--data '
{
    "name": "Webhook name",
    "url": "${WEBHOOK-URL}",
    "token": "",
    "headers": [],
    "auth": {}
}
'

Request URL

{ "name": "Webhook name", "url": "${WEBHOOK-URL}", "token": "", "headers": [], "auth": {} }

Response Example

{
    "id": "58ee2e085d033800059a3f7f",
    "timestamp": "2018-01-12T13:40:40.260Z",
    "status": {
        "code": 200,
        "type": "success"
    }
}

Properties

Property Type Description
name String Webhook name.

String(1, 1024)
url String Webhook public url.
token String Token which can be used to verification incoming webhooks.

String(0, 1024)
headers Array.<Object> Array of objects which includes request headers.

Array(0, 99)
auth Object Object for basic auth authorization.

Update a webhook

Updates a webhook.

PUT https://api.chatbot.com/webhooks/:ID

Request URL

curl --request PUT \
	--url https://api.chatbot.com/webhooks/:ID \
	--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}' \
	--header 'content-type: application/json' \
	--data '
{
    "name": "Webhook name",
    "url": "${WEBHOOK-URL}",
    "token": "",
    "headers": [],
    "auth": {}
}
'

Response Example

{
    "id": "58ee2e085d033800059a3f7f",
    "timestamp": "2018-01-12T13:40:40.260Z",
    "status": {
        "code": 200,
        "type": "success"
    }
}

Properties

Property Type Description
name String Webhook name.

String(1, 1024)
url String Webhook public url.
token String Token which can be used to verification incoming webhooks.

String(0, 1024)
headers Array.<Object> Array of objects which includes request headers.

Array(0, 99)
auth Object Object for basic auth authorization.

Delete a webhook

Removes a webhook.

curl --request DELETE \
	--url https://api.chatbot.com/webhooks/:ID \
	--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}' \
	--header 'content-type: application/json'

Request URL

Response Example

{
    "id": "58ee2e085d033800059a3f7f",
    "timestamp": "2018-01-12T13:40:40.260Z",
    "status": {
        "code": 200,
        "type": "success"
    }
}

Common object definitions

headers

Array of request headers.

Property Type Description
name String Header name.

String(1, 128)
value String Header value.

String(1, 1024)

auth

Property Type Description
username String Basic auth username.

String(1, 1024)
password String Basic auth password.

String(1, 1024)

Webhook integration examples

Don’t know how to setup your first ChatBot webhook? Check it here or get our ready to use examples:

Start a free ChatBot trial
and build your first chatbot today!

Free 14-day trial No credit card required

Discover our other products