.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:

PropertyDatatypeDescription
idStringID of the chat
questionStringThe question with which the chat was initiated
attenderNameStringName of the chat attender
attenderEmailStringEmail of the chat attender
attenderIDStringID of the chat attender
departmentNameStringName of the department to which the chat is associated
feedbackStringFeedback provided for the chat
lastMessage 
(Deprecated)
StringLast message in the chat
statusSIQChatStatusThe status of the chat
ratingStringRating given for the chat
unreadCountintUnread message count for the chat
isBotAttenderboolFlag to check if the last chat was attended by a bot
lastMessageSender
(Deprecated)
StringName of the last message sender
lastMessageTime 
(Deprecated)
DateTimeTime of the last message in chat
queuePositionintPosition of the chat in current queue

SIQMessage:

The SIQMessage object contains the last message's content and its metadata.

PropertyDatatypeDescription
timeDateTimeTime of the last message sent in chat
textStringLast message text in the chat
senderStringName of the sender of the last message
isReadboolTo check if the last message was read
fileFileIf 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.

PropertyDatatypeDescription
nameStringFile name of the last message
sizeintFile size of the last message
contentTypeStringFile MIME type of the last message (Ex: image/jpeg, video/mp4, audio/mp3, etc..)
commentStringFile 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:

SIQChatStatusDescription
SIQChatStatus.openList of all open chats.
SIQChatStatus.connectedList of all connected chats.
SIQChatStatus.waitingList of all chats yet to be picked up by an operator.
SIQChatStatus.closedList of all closed chats.
SIQChatStatus.missedList of all missed chats.
SIQChatStatus.endedList of all ended chats

Error handling:

CodeMessage
605mobilisten disabled

Usage

CopiedZohoSalesIQ.getChats.then((chatList){
  // your code goes here
}).catchError((error){
  // your code to handle errors
});