Live Chat API Documentation
  • 22 Feb 2024
  • 1 Minute to read
  • Contributors
  • PDF

Live Chat API Documentation

  • PDF

Article summary

Live Chat - API Documentation

This document aims to describe how to start conversation and send messages to Live Chat.

1. Start Conversation

Sample request body:

This is an example request body to start conversation:

URL: {{base_url}}/api/v1/conversation

Method: POST

Body:
{
  "tenantName": "string",
  "skillNames": [
    "string"
  ],
  "queueName": "string",
  "channelId": "string",
  "clientInfo": {
    "id": "string",
    "name": "string"
  },
  "externalHistory": [
    {
      "sessionId": "string",
      "messageDate": Date,
      "source": "string",
      "text": "string",
      "chatId": guid
    }
  ]
}
Necessary references
  • Tenant name: The tenant info in Live Chat.

  • Skill names: An optional parameter to start conversation according to specified skills.

  • Queue name: Queue info in the Live Chat that the conversation shall be assigned.

  • Channel Id: An Id that uniquely identifies a channel.

  • Client Info:

    • id: The id for the user or bot on this channel.
    • name: The name of the user or bot.
  • ExternalHistory: Conversation history of the user before Live Chat.

    • sessionId: Conversation unique id.
    • messageDate: Date of the message.
    • source: Message's source (from bot or the user).
    • text: Content of the message itself.
    • chatId: A unique id for the external chat.

After sending request, you will get a response body.

Sample response body:

{
  "id": <conversation Id>,
  "status": "Pending"
}

2. Send Message

After starting the conversation, message could be sent as followed:

URL: {{base_url}}/api/v1/conversation

Method: POST

Body:
{
  "tenantName": "string",
  "text": "string",
  "conversationId": guid,
  "attachments": [
    {
      "name": "string",
      "extension": "string",
      "isVoiceMessage": boolean,
      "category": "string",
      "content": byte[]
    }
  ]
}
Necessary references
  • Tenant name: The tenant info in Live Chat.

  • Text is the message itself.

  • Conversation Id is the Id that is started in the Live Chat.

  • Attachments are the files that are sent via a message,

    • name: Name of the file.
    • extension: Extension of the file.
    • isVoiceMessage: if it is true, it is a voice message.
    • category: Category of the attachments (image, audio, video, document, other).

Sample response body:

{
  "id": guid
}

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.