.getChats()
This API is used to get a list of all support chats created by a visitor. The API returns a list of instances of the SIQChat class which contains information for each support chat.
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 (Deprecated) | 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 (Deprecated) | String | Name of the last message sender |
| lastMessageTime (Deprecated) | DateTime | Time of the last message in chat |
| queuePosition | int | Position of the chat in current queue |
SIQMessage:
The SIQMessage object contains the last message's content and its metadata.
| Property | Datatype | Description |
| time | DateTime | 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 | bool | To check if the last message was read |
| file | File | If the last message is a file, 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 | Datatype | 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 |
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.getChats.then((chatList){
// your code goes here
}).catchError((error){
// your code to handle errors
});