Chat API

Endpoint used to converse with a chat automation virtual agent.


Request

post/converse/chat
Headers Parameters:
  1. 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.

  2. botidstringRequired

    The ID of the bot that is sending the event.

Body

Required
Request Body Schema: application/json
  1. platformConversationIdstringRequired

    An ID provided by the custom CRM to identify the conversation. The custom CRM application can decide the format.

  2. 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.

  3. 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).

  4. 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.

    1. keystring

      Name the session parameter, can be referenced by to personalize a conversation.

    2. valuestring

      Value of the session parameter, note that we only support values of type string at this moment.

    3. sanitizeboolean

      An Optional field, should be set as true for PII data.

  5. 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
}