.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 |
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 |
lastMessage | Last message in the chat |
lastMessageSender | Name of the last message sender |
lastMessageTime | Time when the last message was sent in chat |
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:
ZohoSalesIQ.Chat.getList(filter: ChatStatus.open) { (error, chats) in
//your code goes here
}