.getChatsWithFilter()
This API is used to get a list of all support chats created by a visitor with an additional option to provide a status filter. The API returns a list of instances of the SIQChat class which contains information for each support chat.
Parameter:
Name | Datatype | Description |
chatStatus | SIQChatStatus | The type of chats to be returned as result to the API invocation. |
SIQChat class contains the following properties:
Property | Datatype | Description |
id | String | 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 | 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 | String | Last message in the chat |
status | SIQChatStatus | The status of the chat |
rating | String | Rating given for the chat |
unreadCount | int | Unread message count for the chat |
isBotAttender | bool | Flag to check if the last chat was attended by a bot |
lastMessageSender | String | Name of the last message sender |
lastMessageTime | DateTime | Time of the last message in chat |
queuePosition | int | Position of the chat in current queue |
SIQChatStatus is an Enumerated type used to represent the type of chat. A chat can have the following status values:
SIQChatStatus | Description |
SIQChatStatus.open | List of all open chats. |
SIQChatStatus.connected | List of all connected chats. |
SIQChatStatus.waiting | List of all chats yet to be picked up by an operator. |
SIQChatStatus.closed | List of all closed chats. |
SIQChatStatus.missed | List of all missed chats. |
SIQChatStatus.ended | List of all ended chats |
Error handling:
Code | Message |
605 | mobilisten disabled |
Usage
CopiedZohoSalesIQ.getChatsWithFilter(chatStatus).then((chatList){
// your code goes here
}).catchError((error){
// your code to handle errors
});