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:
Name | Description |
conversationType | The type of chat that is required |
conversationListener | Callback listener to listen to success and error callbacks |
ConversationType:
ConversationType | Description |
ConversationType.OPEN | List of all open chats |
ConversationType.WAITING | List of all chats that are yet to be picked up by an operator |
ConversationType.CONNECTED | List of chats connected to an operator |
ConversationType.CLOSED | List of all closed chats |
ConversationType.MISSED | List of all missed chats |
ConversationType.ENDED | A 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:
Codes | Message |
600 | no network connection |
605 | mobilisten disabled |
609 | salesIQ 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
}
});