All docs This doc
Skip to end of metadata
Go to start of metadata


Overview

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

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

OperationDescription

createAgent

Creates a new agent in your license.

getAgentByLoginIdRetrieves complete details of the agent for the given login.
listAgentsRetrieves the list of LiveChat agents.

Operation details

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

Creating a new agent

The createAgent operation creates a new agent in your license.

createAgent
<livechat.createAgent>
    <notificationNewVisitor>{$ctx:notificationNewVisitor}</notificationNewVisitor>
    <loginStatus>{$ctx:loginStatus}</loginStatus>
    <notificationQueuedVisitor>{$ctx:notificationQueuedVisitor}</notificationQueuedVisitor>
    <dailySummary>{$ctx:dailySummary}</dailySummary>
    <notificationVisitorIsTyping>{$ctx:notificationVisitorIsTyping}</notificationVisitorIsTyping>
    <notificationVisitorNewGoal>{$ctx:notificationVisitorNewGoal}</notificationVisitorNewGoal>
    <permission>{$ctx:permission}</permission>
    <password>{$ctx:password}</password>
    <maxChatsCount>{$ctx:maxChatsCount}</maxChatsCount>
    <agentLogin>{$ctx:agentLogin}</agentLogin>
    <notificationIncomingChat>{$ctx:notificationIncomingChat}</notificationIncomingChat>
    <notificationReturningVisitor>{$ctx:notificationReturningVisitor}</notificationReturningVisitor>
    <name>{$ctx:name}</name>
    <groups>{$ctx:groups}</groups>
	<jobTitle>{$ctx:jobTitle}</jobTitle>
</livechat.createAgent>
Properties
  • notificationNewVisitor: Enables new visitor notification. Allowed values: 0 or 1.
  • loginStatus: Status of the login. Possible values are "accepting chats" (default) and "not accepting chats".
  • notificationQueuedVisitor: Enables queued visitor notification. Allowed values: 0 or 1.
  • dailySummary: The Boolean value that indicates whether to create the daily summary (0 or 1 (default)).
  • notificationVisitorIsTyping: Enables visitor typing notification. Allowed values: 0 or 1. 
  • notificationVisitorNewGoal: Enables visitor new goal notification. Allowed values: 0 or 1. 
  • permission: The permission level for the agent account: "administrator", "normal" (default).
  • password: The password for the agent account. The minimum length is 5. (if not provided, an e-mail with the activation link will be sent.)
  • maxChatsCount: The maximum count of the chat(s). Defaults to 6.
  • agentLogin: The e-mail address for the login agent.
  • notificationIncomingChat: Enables incoming chat notification. Allowed values: 0 or 1. 
  • notificationReturningVisitor: Enables returning visitor notification. Allowed values: 0 or 1. 
  • name: The name of the agent. 
  • groups: An array which contains a list of group IDs.
  • jobTitle: The job title of the agent. Defaults to: "Support Agent".
Sample request

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

Sample Request for createAgent
{
    "apiUrl": "https://api.livechatinc.com",
    "apiKey": "81df74bda524d8027f0717cffaf318b2",
    "login": "anu.thushi@gmail.com",
    "name": "Matt Wood11",
    "agentLogin": "testapp.matt11@gmail.com",
    "maxChatsCount": "5",
    "notificationNewVisitor": 0,
    "notificationReturningVisitor": 0,
    "notificationQueuedVisitor": 0,
    "notificationVisitorIsTyping": 0,
    "notificationVisitorNewGoal": 0,
    "notificationIncomingChat":0,
    "loginStatus": "not accepting chats",
    "dailySummary": "0",
    "permission": "administrator",
    "password": "1qaz2wsx@",
    "groups": [
        "1",
        "2"
    ],
    "jobTitle": "Software Engineer"
}
Related LiveChat documentation

http://developers.livechatinc.com/rest-api/#create-agent

Retrieving complete details of the agent

The getAgentByLoginId operation retrieves complete details of the agent for the given login.

getAgentByLoginId
<livechat.getAgentByLoginId>
    <acessToken>{$ctx:acessToken}</acessToken>
    <agentLogin>{$ctx:agentLogin}</agentLogin>
	<apiUrl>{$ctx:apiUrl}</apiUrl>
</livechat.getAgentByLoginId>
Properties
  • acessToken: Refers to the generated access token.
  • agentLogin: The e-mail address for the login agent.
  • apiUrl: The API URL of LiveChat. 
Sample request

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

Sample Request for getAgentByLoginId
{
	"apiUrl":"https://api.livechatinc.com",
	"apiKey":"81df74bda524d8027f0717cffaf318b2",
	"login":"anu.thushi@gmail.com",
	"agentLogin":"testapp.matt3@gmail.com"
}
Related LiveChat documentation

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

Retrieving the LiveChat agents list

The listAgents operation retrieves the LiveChat agents list.

listAgents
<livechat.listAgents>
	<status>{$ctx:status}</status>
</livechat.listAgents>
Properties
  • status: The status of the agent. Values can be "accepting chats", "not accepting chats", or "offline".
Sample request

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

Sample Request for listAgents
{
	"apiUrl":"https://api.livechatinc.com",
	"apiKey":"81df74bda524d8027f0717cffaf318b2",
	"login":"anu.thushi@gmail.com",
	"status":"offline"
}
Related LiveChat documentation

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

Sample configuration

Following is a sample proxy service that illustrates how to connect to LiveChat with the init operation and use the createAgent operation. The sample request for this proxy can be found in the createAgent sample request. You can use this sample as a template for using other operations in this category.

Sample Proxy
<?xml version="1.0" encoding="UTF-8"?>
	<proxy xmlns="http://ws.apache.org/ns/synapse" name="livechat_createAgent" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
	 <target>
	 <inSequence>
      <property name="apiUrl" expression="json-eval($.apiUrl)"/>
      <property name="login" expression="json-eval($.login)"/>
      <property name="apiKey" expression="json-eval($.apiKey)"/>
      <property name="notificationNewVisitor" expression="json-eval($.notificationNewVisitor)"/>
      <property name="loginStatus" expression="json-eval($.loginStatus)"/>
      <property name="notificationQueuedVisitor" expression="json-eval($.notificationQueuedVisitor)"/>
      <property name="dailySummary" expression="json-eval($.dailySummary)"/>
      <property name="notificationVisitorIsTyping" expression="json-eval($.notificationVisitorIsTyping)"/>
      <property name="notificationVisitorNewGoal" expression="json-eval($.notificationVisitorNewGoal)"/>
      <property name="permission" expression="json-eval($.permission)"/>
      <property name="password" expression="json-eval($.password)"/>
      <property name="maxChatsCount" expression="json-eval($.maxChatsCount)"/>
      <property name="agentLogin" expression="json-eval($.agentLogin)"/>
      <property name="notificationIncomingChat" expression="json-eval($.notificationIncomingChat)"/>
      <property name="notificationReturningVisitor" expression="json-eval($.notificationReturningVisitor)"/>
      <property name="name" expression="json-eval($.name)"/>
      <property name="groups" expression="json-eval($.groups)"/>
      <property name="jobTitle" expression="json-eval($.jobTitle)"/>
      <livechat.init>
         <apiUrl>{$ctx:apiUrl}</apiUrl>
         <login>{$ctx:login}</login>
         <apiKey>{$ctx:apiKey}</apiKey>
      </livechat.init>
      <livechat.createAgent>
         <notificationNewVisitor>{$ctx:notificationNewVisitor}</notificationNewVisitor>
         <loginStatus>{$ctx:loginStatus}</loginStatus>
         <notificationQueuedVisitor>{$ctx:notificationQueuedVisitor}</notificationQueuedVisitor>
         <dailySummary>{$ctx:dailySummary}</dailySummary>
         <notificationVisitorIsTyping>{$ctx:notificationVisitorIsTyping}</notificationVisitorIsTyping>
         <notificationVisitorNewGoal>{$ctx:notificationVisitorNewGoal}</notificationVisitorNewGoal>
         <permission>{$ctx:permission}</permission>
         <password>{$ctx:password}</password>
         <maxChatsCount>{$ctx:maxChatsCount}</maxChatsCount>
         <agentLogin>{$ctx:agentLogin}</agentLogin>
         <notificationIncomingChat>{$ctx:notificationIncomingChat}</notificationIncomingChat>
         <notificationReturningVisitor>{$ctx:notificationReturningVisitor}</notificationReturningVisitor>
         <name>{$ctx:name}</name>
         <groups>{$ctx:groups}</groups>
         <jobTitle>{$ctx:jobTitle}</jobTitle>
      </livechat.createAgent>
	   <respond/>
	 </inSequence>
	  <outSequence>
	   <send/>
	  </outSequence>
	 </target>
   <description/>
  </proxy>                                                                                           
  • No labels