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

PropertyDescription
referenceIDID of the chat
questionThe question with which the chat was started
unreadCountUnread message count of the chat
feedbackFeedback provided for the chat
ratingRating given for the chat
statusStatus of the chat
queuePosition    

Position in the queue for a queued chat.

Note: The queue position is -1 if the chat is not queued.

attenderIDUnique ID of the chat attender
isBotAttenderFlag to check if the chat is last attended by a bot
departmentNameDepartment to which the chat is connected to
attenderNameName of the chat attender
attenderEmailEmail ID of the chat attender

Last Message:

 LastMessage  shows the properties of the chat. A chat can have the following properties:

Last MessageDescription
.lastMessage.timeTime of the last message sent in chat
.lastMessage.senderName of the sender of the last message
.lastMessage.isReadTo check if the last message was read
.lastMessage.isEditedTo check if the last message was edited
.lastMessage.isDeletedTo check if the last message was deleted
.lastMessage.fileIf the last message is a file, this property will return the details of the file
.lastMessage.file.nameFile name of the last message
.lastMessage.file.sizeFile size of the last message
.lastMessage.file.contentTypeFile type of the last message (Ex: Image, gif, video,etc)
.lastMessage.file.commentFile comment of the last message

ChatStatus:

 ChatStatus  shows the status of the chat. A chat can have the following status values:

Chat StatusDescription
ChatStatus.openThe combined list of connected, waiting, triggered and proactive chats
ChatStatus.connectedList of all open chats that are connected to an agent or a bot
ChatStatus.waitingList of all open chats that are yet to be picked up by an operator or a bot
ChatStatus.triggeredList of all triggered chats
ChatsStatus.proactiveList of all proactive chats
ChatStatus.missedList of all missed chats
ChatStatus.closedList of all closed chats
ChatStatus.endedThe combined list of missed and closed chats

Error Handling

CodeDescription
500Mobilisten not initialized
605Mobilisten disabled

Usage:

CopiedZohoSalesIQ.Chat.getList(filter: ChatStatus.open) { (error, chats) in
	//your code goes here
}