Chat.getList ()

This API is used to get a list of all support chats created by a visitor. The API returns a list of VisitorChat 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.

Parameters:

NameDescription
conversationTypeThe type of chat that is required
conversationListenerCallback listener to listen to success and error callbacks

ConversationType:

ConversationTypeDescription
ConversationType.OPENList of all open chats
ConversationType.WAITINGList of all chats that are yet to be picked up by an operator
ConversationType.CONNECTEDList of chats connected to an operator
ConversationType.CLOSEDList of all closed chats
ConversationType.MISSEDList of all missed chats
ConversationType.ENDEDA combined list of all missed and closed chats

VisitorChat class contains the following properties:

Method

Description

getChatID()

ID of the chat

getQuestion()

The question with which the chat was started

getUnreadCount()

Unread message count of the chat

getFeedbackMessage()

Feedback provided for the chat

getRating()

Rating given for the chat

getChatStatus()

Status of the chat

getQueuePosition()    

Position in the queue for a queued chat.

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

getAttenderId()

Unique ID of the chat attender

isBotAttender()

Flag to check if the chat is last attended by a bot

getDepartmentName()

Department to which the chat is connected to

getAttenderName()

Name of the chat attender

getAttenderEmail()

Email ID of the chat attender

Last Message:

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

Last Message

Description

getLastMessage().getTime()

Time of the last message sent in chat

getLastMessage().getSender()

Name of the sender of the last message

getLastMessage().isRead()

To check if the last message was read.

getLastMessage().getSenderId()

User ID of the last message sender.

getLastMessage().getSentByVisitor()

Returns a boolean value to check whether the last message is sent by the visitor or not.

getLastMessage().getFile()

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

getLastMessage().getFile().getName()

File name of the last message

getLastMessage().getFile().getSize()

File size of the last message

getLastMessage().getFile().getContentType()

File MIME type of the last message (Ex: image/jpeg, video/mp4, audio/mp3, etc..)

getLastMessage().getFile().getComment()

File comment of the last message

Error Codes:

CodesMessage
600no network connection
605mobilisten disabled
609salesIQ api exception

Syntax:

CopiedZohoSalesIQ.Chat.getList(ConversationType conversationType, ConversationListener conversationListener);

Example:

CopiedZohoSalesIQ.Chat.getList(ConversationType.OPEN, new ConversationListener()
{
    @Override
    public void onSuccess(ArrayList<VisitorChat>chats)
   {
      //your code
   }
    @Override
    public void onFailure(int code, String message)
   {
      //your code 
   }
});