This documentation applies to older versions of WSO2 ESB connectors. To find the documentation relevant to the version you are using, select the connector from the WSO2 Connector Store and click Documentation.

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


Overview

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

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

OperationDescription

createTicket

Creates a new ticket.

getTicketByIdRetrieves a single ticket item for the given ticket ID.
listTicketsRetrieves all tickets.

Operation details

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

Creating a new ticket 

The createTicket operation creates a new ticket.

createTicket
<livechat.createTicket>
    <message>{$ctx:message}</message>
    <sourceType>{$ctx:sourceType}</sourceType>
    <subject>{$ctx:subject}</subject>
    <assigneeId>{$ctx:assigneeId}</assigneeId>
    <requesterEmail>{$ctx:requesterEmail}</requesterEmail>
    <requesterName>{$ctx:requesterName}</requesterName>
    <group>{$ctx:group}</group>
	<sourceUrl>{$ctx:sourceUrl}</sourceUrl>
</livechat.createTicket>
Properties
  • message: The requester's message.
  • sourceType: The source of the ticket. Possible values: "chat-window", "mail", "lc2". Default: "lc2".
  • subject: The ticket subject. Defaults to "(no subject)".
  • assigneeId: The login ID of the agent that will be assigned to the ticket.
  • requesterEmail: The requester's e-mail address.
  • requesterName: The requester's name.
  • group: The list of groups. Must be an array with group IDs. Defaults to [0].
  • sourceUrl: The URL of the website from which the ticket was sent. Applies only if source[type] is "chat-window".
Sample request

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

Sample Request for createTicket
{
	"apiUrl":"https://api.livechatinc.com",
	"login":"[email protected]",
	"apiKey":"81df74bda524d8027f0717cffaf318b2",
	"message":"Message",
	"sourceType":"chat-window",
	"subject":"Test Subject",
	"assigneeId":"[email protected]",
	"requesterEmail":"[email protected]",
	"requesterName":"Chamath",
	"group":[0,2],
	"sourceUrl":"www.krishantha.net"
}
Related LiveChat documentation

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

Retrieving a single ticket item 

The getTicketyById operation retrieves a single ticket item for the given ticket ID. 

getTicketyById
<livechat.getTicketById>
	<ticketId>{$ctx:ticketId}</ticketId>
</livechat.getTicketById>
Properties
  • ticketId: The ticket ID to retrieve a ticket item.
Sample request

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

Sample Request for getTicketById
{
	"apiUrl":"https://api.livechatinc.com",
	"login":"[email protected]",
	"apiKey":"81df74bda524d8027f0717cffaf318b2",
	"ticketId":"Q62JR"
}
Related LiveChat documentation

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

Retrieving all tickets

The listTickets operation retrieves all tickets.

listTickets
 <livechat.listTickets>
    <status>{$ctx:status}</status>
    <dateTo>{$ctx:dateTo}</dateTo>
    <query>{$ctx:query}</query>
    <requesterMail>{$ctx:requesterMail}</requesterMail>
    <tag>{$ctx:tag}</tag>
    <assigned>{$ctx:assigned}</assigned>
    <assignee>{$ctx:assignee}</assignee>
    <order>{$ctx:order}</order>
    <source>{$ctx:source}</source>
    <page>{$ctx:page}</page>
    <tagged>{$ctx:tagged}</tagged>
    <dateFrom>{$ctx:dateFrom}</dateFrom>
	<group>{$ctx:group}</group>
</livechat.listTickets>
Properties
  • status: Not set by default. Possible values: "open", "pending", "solved", "spam".
  • dateTo: Returns tickets with any of their activities matching the date. Defaults to "today".
  • query: Returns tickets containing the query.
  • requesterMail: Returns tickets assigned to the given requester.
  • tag: Returns tickets for the specified tag.
  • assigned: If 0, returns only unassigned tickets. If 1, returns only tickets assigned to any agent.
  • assignee: Returns tickets assigned to given agent's login.
  • order: Orders tickets by date of last ticket modification. Possible values: "desc", "asc". Default: "desc".
  • source: Returns tickets for the given source. Possible values: "lc2" (created from archives), "mail", "facebook", "agent-app-manual" (created manually), "chat-window" (created from ticket form).
  • page: The page number, defaults to 1.
  • tagged: If 1 is passed, returns tickets having any tag. If 0 is passed, returns tickets without any tag.
  • dateFrom: Returns tickets with any of their activities matching the date. Defaults to the beginning of time.
  • group: Returns tickets for a given group.
Sample request

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

Sample Request for listTickets
{
	"apiUrl":"https://api.livechatinc.com",
	"login":"[email protected]",
	"apiKey":"81df74bda524d8027f0717cffaf318b2",
	"dateTo":"2015-02-25",
	"assignee":"[email protected]",
	"order":"asc",	
	"page":"1",
	"tagged":"0",
	"dateFrom":"2015-02-01",	
	"group":"0"
}

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-tickets

Sample configuration

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