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


Overview

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

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

OperationDescription

createGroup

Creates a new group in your license.

getGroupByIdRetrieves group details for the given group ID.
listGroupsRetrieves all created groups.

Operation details

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

Creating a new group 

The createGroup operation creates a new group in your license.

createGroup
<livechat.createGroup>
    <agents>{$ctx:agents}</agents>
    <name>{$ctx:name}</name>
	<language>{$ctx:language}</language>
</livechat.createGroup>
Properties
  • agents: An array of LiveChat users' logins (e-mail addresses).
  • name: The group name.
  • language: The group language (defaults to English).
Sample request

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

Sample Request for createGroup
{
	"apiUrl":"https://api.livechatinc.com",
	"login":"anu.thushi@gmail.com",
	"apiKey":"81df74bda524d8027f0717cffaf318b2",
	"agents":["anu.thushi@gmail.com","testapp.mahesh@gmail.com"],
	"name":"TG",
	"language":"es"
}
Related LiveChat documentation

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

Retrieving group details 

The getGroupById operation retrieves group details for the given group ID.

getGroupById
<livechat.getGroupById>
	<groupId>{$ctx:groupId}</groupId>
</livechat.getGroupById>
Properties
  • groupId: The ID of the group.
Sample request

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

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

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

Retrieving all created groups

The listGroups operation retrieves all created groups.

listGroups
<livechat.listGroups>
</livechat.listGroups>
Sample request

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

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

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

Sample configuration

Following is a sample proxy service that illustrates how to connect to LiveChat with the init operation and use the createGroup operation. The sample request for this proxy can be found in the createGroup 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_createGroup" 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="agents" expression="json-eval($.agents)"/>
      <property name="name" expression="json-eval($.name)"/>
      <property name="language" expression="json-eval($.language)"/>
      <livechat.init>
         <apiUrl>{$ctx:apiUrl}</apiUrl>
         <login>{$ctx:login}</login>
         <apiKey>{$ctx:apiKey}</apiKey>
      </livechat.init>
      <livechat.createGroup>
         <agents>{$ctx:agents}</agents>
         <name>{$ctx:name}</name>
         <language>{$ctx:language}</language>
      </livechat.createGroup>
	   <respond/>
	 </inSequence>
	  <outSequence>
	   <send/>
	  </outSequence>
	 </target>
   <description/>
  </proxy>                                                                                          
  • No labels