Working with Chats in LiveChat

This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Working with Chats in LiveChat



Overview

The following operations allow you to work with chats. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with chats, see Sample configuration

Operation

Description

getChatById

Retrieves a single chat item for the given Chat ID.

listChats

Retrieves finished chats and left messages.

sendChatTranscriptByEmail

Sends a chat transcript to an e-mail address.

Operation details

This section provides further details on the operations related to chats.

Retrieving a single chat item 

The getChatById operation retrieves a single chat item for the given Chat ID. 

getChatById
<livechat.getChatById> <chatId>{$ctx:chatId}</chatId> </livechat.getChatById>
Properties
  • chatId: The chat ID to return a single chat.

Sample Request

Following is a sample REST/JSON request that can be handled by the getChatById operation.

Sample request for getChatById
{ "apiUrl":"https://api.livechatinc.com", "login":"anu.thushi@gmail.com", "apiKey":"81df74bda524d8027f0717cffaf318b2", "chatId":"NJHV7BG1C5" }
Related LiveChat Documentation  

http://developers.livechatinc.com/rest-api/#get-single-chat

Retrieving finished chats and left messages

The listChats operation retrieves finished chats and left messages. 

listChats
<livechat.listChats> <queued>{$ctx:queued}</queued> <tag>{$ctx:tag}</tag> <dateTo>{$ctx:dateTo}</dateTo> <query>{$ctx:query}</query> <includePending>{$ctx:includePending}</includePending> <agent>{$ctx:agent}</agent> <goal>{$ctx:goal}</goal> <timezone>{$ctx:timezone}</timezone> <rate>{$ctx:rate}</rate> <page>{$ctx:page}</page> <visitorId>{$ctx:visitorId}</visitorId> <hasGoal>{$ctx:hasGoal}</hasGoal> <tagged>{$ctx:tagged}</tagged> <dateFrom>{$ctx:dateFrom}</dateFrom> <group>{$ctx:group}</group> </livechat.listChats>
Properties
  • queued: 1 or 0. If 1 is passed, returns chats started from the queue.

  • tag: Filters chats by a specified tag.

  • dateTo: Returns chats with any of their activities matching the date. Defaults to "today".

  • query: Returns chats containing the query.

  • includePending: 1 or 0. Indicates whether to include chats that have not yet ended. Pending chats can be recognized by the "pending : true" attribute. They may appear with some delay due to caching reasons. 

  • agent: Returns chats for a given agent login.

  • goal: Returns chats for a given goal ID.

  • timezone: The timezone in the TZ format (e.g. America/Phoenix).

  • rate: Filters chats considering their rating status. Available values: "rated", "not_rated", "rated_good", "rated_bad".

  • page: The page number, defaults to 1.

  • visitorId: Returns chats with a specified visitor ID.

  • hasGoal: 1 or 0. If 1 is passed, returns chats having any goal.

  • tagged: 1 or 0. If 1 is passed, returns chats having any tag. If 0 is passed, returns chats without any tag.

  • dateFrom: Returns chats with any of their activities matching the date. Defaults to the beginning of time.

  • group: Returns chats for the given group ID.

Sample Request

Following is a sample REST/JSON request that can be handled by the listChats operation.

Sample request for listChats
{ "apiUrl":"https://api.livechatinc.com", "login":"anu.thushi@gmail.com", "apiKey":"81df74bda524d8027f0717cffaf318b2", "includePending":"1" }

Note

There are more optional parameters available. For more information on the usage of these parameters please check the API document. 

Related LiveChat Documentation

http://developers.livechatinc.com/rest-api/#get-chats

Sending a chat transcript to an e-mail address

The sendChatTranscriptByEmail operation sends a chat transcript to an e-mail address.

sendChatTranscriptByEmail
<livechat.sendChatTranscriptByEmail> <to>{$ctx:to}</to> <chatId>{$ctx:chatId}</chatId> </livechat.sendChatTranscriptByEmail>
Properties
  • to: The receiver's email address.

  • chatId: The chat ID to send the transcript.

Sample Request

Following is a sample REST/JSON request that can be handled by the sendChatTranscriptByEmail operation.

Sample request for sendChatTranscriptByEmail
{ "apiUrl":"https://api.livechatinc.com", "login":"anu.thushi@gmail.com", "apiKey":"81df74bda524d8027f0717cffaf318b2", "chatId":"NJHV7BG1C5", "to":"janaka.n.ranathunga@gmail.com" }
Related LiveChat Documentation

http://developers.livechatinc.com/rest-api/#send-chat-transcript