.Chat.getList()
This API is used to get a list of all support chats created by a visitor. The API returns a list of SIQVisitorChat objects which contain information for each support chat. The list of chats fetched by this API can optionally be filtered to get the desired set of conversations based on the status using the filter function parameter.
SIQVisitorChat class contains the following properties:
Property | Description |
referenceID | ID of the chat |
question | The question with which the chat was started |
unreadCount | Unread message count of the chat |
feedback | Feedback provided for the chat |
rating | Rating given for the chat |
status | Status of the chat |
queuePosition | Position in the queue for a queued chat. Note: The queue position is -1 if the chat is not queued. |
attenderID | Unique ID of the chat attender |
isBotAttender | Flag to check if the chat is last attended by a bot |
departmentName | Department to which the chat is connected to |
attenderName | Name of the chat attender |
attenderEmail | Email ID of the chat attender |
Last Message:
LastMessage shows the properties of the chat. A chat can have the following properties:
Last Message | Description |
.lastMessage.time | Time of the last message sent in chat |
.lastMessage.sender | Name of the sender of the last message |
.lastMessage.isRead | To check if the last message was read |
.lastMessage.isEdited | To check if the last message was edited |
.lastMessage.isDeleted | To check if the last message was deleted |
.lastMessage.file | If the last message is a file, this property will return the details of the file |
.lastMessage.file.name | File name of the last message |
.lastMessage.file.size | File size of the last message |
.lastMessage.file.contentType | File type of the last message (Ex: Image, gif, video,etc) |
.lastMessage.file.comment | File comment of the last message |
ChatStatus:
ChatStatus shows the status of the chat. A chat can have the following status values:
Chat Status | Description |
ChatStatus.open | The combined list of connected, waiting, triggered and proactive chats |
ChatStatus.connected | List of all open chats that are connected to an agent or a bot |
ChatStatus.waiting | List of all open chats that are yet to be picked up by an operator or a bot |
ChatStatus.triggered | List of all triggered chats |
ChatsStatus.proactive | List of all proactive chats |
ChatStatus.missed | List of all missed chats |
ChatStatus.closed | List of all closed chats |
ChatStatus.ended | The combined list of missed and closed chats |
Error Handling
Code | Description |
500 | Mobilisten not initialized |
605 | Mobilisten disabled |
Usage:
CopiedZohoSalesIQ.Chat.getList(filter: ChatStatus.open) { (error, chats) in
//your code goes here
}