Skip to main content

.getChats()

 This API allows you to programmatically get a list of all chats had by the visitor. This API can be used as a source of data to make custom support user interfaces.

Chat Properties:

PropertyDatatypeDescription
idStringThe ID of the chat
questionStringThe question with which the chat was initiated
attenderNameStringName of the chat attender
attenderEmailStringEmail of the chat attender
attenderIDStringThe ID 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
statusStringThe status of the chat
ratingStringRating given for the chat
unreadCountintUnread message count for the chat
isBotAttenderBooleanFlag to check if the last chat was attended by a bot
lastMessageSender 
(Deprecated)
StringName of the last message sender
lastMessageTime 
(Deprecated)
longTime of the last message in the chat
queuePositionintPosition of the chat in current queue
recentMessageMapIt contains the last message's content and its metadata.

RecentMessage:

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

PropertyData typeDescription
timelongTime of the last message sent in chat
textStringLast message text in the chat
senderStringName of the sender of the last message
isReadbooleanTo check if the last message was read.
fileMapThis property will return the details of the file.

File:

If the last message is a file, this property provides details of the file.

PropertyData typeDescription
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

Callbacks:

NameDescription
errorError is returned if an error occurs while using the API. The list of possible error codes returned by the API is listed below.
chatsList of chats

​Error Codes:​

CodeMessage
500mobilisten not initialized
605mobilisten disabled
600no network connection 
609salesiq api exception

Usage

CopiedZohoSalesIQ.getChats(function(chats){
	// your code goes here
}, function(error){
	// your code to handle errors
});