- 22 Feb 2024
- 1 Minute to read
- Contributors
- Print
- PDF
Live Chat API Documentation
- Updated on 22 Feb 2024
- 1 Minute to read
- Contributors
- Print
- PDF
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
}
]
}
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[]
}
]
}
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
}