Webhooks
This article covers webhooks, their expected body request and possible responses.
Why use Webhooks
Ultimate Ticket API leverages webhooks to enhance performance and make conversations more responsive.
Our Ticket API responds with an empty 200 response to indicate that the request has been acknowledged and will be handled. The actual bot response will be sent as a separate webhook request.
Ticket API Webhook event
The Ticket API webhook receives only one type of event that is used to send the message to the visitor.
The structure of the webhook event is the following:
Field | Type | Description |
---|---|---|
botId | string | The ID of the bot that is sending the event. |
conversationId | string | ULTIMATE internal ID |
platformConversationId | string | The ID of the conversation |
text | string | The text of the message. |
predictedIntents | PredictedIntent[] | Predicted intents for visitor message. Each object of type PredictedIntent in the array needs to contain the following fields:value string - the intent idname string - name of the intentconfidence number - confidence in the intent |
attachments | Path[] | Ticket attachment files paths. Each object of type Path in the array needs to contain the following field:path string - the path of the file |
In JSON format:
{ "botId": "618a30beee4e8e87d2f94015", "conversationId": "conversation1", "platformConversationId": "session1", "text": "Hello, this is a bot text message", "predictedIntents": [ { "value": "1234", "name": "intent name", "confidence": 1 } ], "attachments": [ { "path": "path/to/attachment" } ]}
The response structure:
A successful message event will return a 200
response to the webhook request and no response body.
A failed message will return a 4XX - 5XX
range response to the webhook request.
Action Webhook
For action webhook, refer to LINK-ARTICLE-HERE MOVE TO A DIFFERENT ARTICLE