Chat API
Endpoint used to converse with a chat automation virtual agent.
Request
- AuthorizationstringRequired
String API Key for the botId. The key can be generated on custom CRM integration page in our Ultimate.ai Dashboard. Please see Authentication article to learn more.
- botidstringRequired
The ID of the bot that is sending the event.
Body
Requiredapplication/json
- platformConversationIdstringRequired
An ID provided by the custom CRM to identify the conversation. The custom CRM application can decide the format.
- eventTypestringRequired
Type of event from enum values. Use startSession when the conversation is created. The welcomeMessage will be given as a response in case there is one for the specific bot. Use message if sending a visitor message. Use endSession to end the session. Otherwise the Session will end automatically after 2 hours or preconfigured timeout.
- textstring
The text message that the visitor typed into the chat. The text is optional and not used if the eventType is startSession or endSession. If a button was pressed (also in carousels), send the value of the button as text (unless it’s a link button).
- metaDataobject
Sending metadata gives you the ability to send metadata on the user or the session of the conversation. These params will be saved on the session and can be used by the bot to personalize the conversation flows.
- keystring
Name the session parameter, can be referenced by to personalize a conversation.
- valuestring
Value of the session parameter, note that we only support values of type string at this moment.
- sanitizeboolean
An Optional field, should be set as true for PII data.
- cardIndexnumber
The card index of the card that the visitor clicked in the chat. The card index is optional and not used if the eventType is startSession or endSession. Card index start in 0
Response
The request has been acknowledge and will be processed. The actual response will come through webhooks.
Request Body
{ "platformConversationId": "string", "eventType": "string", "text": "string", "metaData": { "key": "string", "value": "string", "sanitize": true }, "cardIndex": 0}