When creating a custom bot on the Sendbird Dashboard, the webhook URL of your server should be registered in Sendbird Desk to integrate your chatbot or a third-party bot. Once registered, your server will receive HTTP
POST requests from the Desk server in the form of the response containing information on all events related to a bot that occur within the application.
Note: You can set a different webhook URL for each bot using the Bot API or in Settings > Desk > Bots of your dashboard.
You can configure a webhook endpoint URL and other relevant settings for each bot in Settings > Desk > Bots of your dashboard.
POST requests with
JSON payloads are sent to your webhook endpoint upon specific events in your Sendbird application.
- The endpoint must support
- The endpoint needs to respond to
- The endpoint needs to parse
By default, Sendbird server sends an HTTP
POST request and waits for a response from your webhook endpoint for 1 second. The server sends the same
POST request up to three times until it receives a response. To avoid too many requests, you should implement the endpoint to respond immediately to the server with a
200 OK response.
Note: When you need a process or function which handles webhook payloads, it should be implemented to be executed asynchronously from that of which responds to the server. If they are executed synchronously, it can cause the endpoint to stop working properly when many events happen on your application.
POST requests from Sendbird server will include the following headers.
Used as a request header to ensure that the source of the request comes from Sendbird server and the request is not altered by external influences. Based on both the
POST request body and your API token, the value of the
x-hub-signature starting with
sha1= is generated by
SHA-1 encryption on the Sendbird server side. To verify the request on your server side, create a comparison value exactly the same way as Sendbird server does, and then check if the result is equal to the value of the
Note: Upon creation, each bot is given a secret key which can be found on your dashboard. The secret key is encrypted and used to generate a value of
x-hub-signatureheader for HTTP requests.
All webhook events depend on the following data structure.
The type of the event.
An object that contains information about the bot and the chat message from a customer.
An object that contains information about the ticket.
A bot receives the message sent by a customer.
The following shows a webhook payload of a