.getChats()
This API allows you to programmatically get a list of all chats had by the visitor. This API can be used as a source of data to make custom support user interfaces.
Chat Properties:
Property | Datatype | Description |
id | String | The ID of the chat |
question | String | The question with which the chat was initiated |
attenderName | String | Name of the chat attender |
attenderEmail | String | Email of the chat attender |
attenderID | String | The ID of the chat attender |
departmentName | String | Name of the department to which the chat is associated |
feedback | String | Feedback provided for the chat |
lastMessage (Deprecated) | String | Last message in the chat |
status | String | The status of the chat |
rating | String | Rating given for the chat |
unreadCount | int | Unread message count for the chat |
isBotAttender | Boolean | Flag to check if the last chat was attended by a bot |
lastMessageSender (Deprecated) | String | Name of the last message sender |
lastMessageTime (Deprecated) | long | Time of the last message in the chat |
queuePosition | int | Position of the chat in current queue |
recentMessage | Map | It contains the last message's content and its metadata. |
RecentMessage:
The RecentMessage object contains the last message's content and its metadata.
Property | Data type | Description |
time | long | Time of the last message sent in chat |
text | String | Last message text in the chat |
sender | String | Name of the sender of the last message |
isRead | boolean | To check if the last message was read. |
file | Map | This property will return the details of the file. |
File:
If the last message is a file, this property provides details of the file.
Property | Data type | Description |
name | String | File name of the last message |
size | int | File size of the last message |
contentType | String | File MIME type of the last message (Ex: image/jpeg, video/mp4, audio/mp3, etc..) |
comment | String | File comment of the last message |
Callbacks:
Name | Description |
error | Error is returned if an error occurs while using the API. The list of possible error codes returned by the API is listed below. |
chats | List of chats |
Error Codes:
Code | Message |
500 | mobilisten not initialized |
605 | mobilisten disabled |
600 | no network connection |
609 | salesiq api exception |
Usage
CopiedZohoSalesIQ.getChats(function(chats){
// your code goes here
}, function(error){
// your code to handle errors
});