Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
maxLevel3
typeflat

...

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

OperationDescription

listTicketFields

Retrieves a list of tickets' fields.

deleteTicketDeletes a particular ticket.
createTicketCreates a new ticket in your help desk.
getTicketRetrieves a particular ticket.
listTicketsRetrieves a list of tickets.
updateTicketUpdates a particular ticket.

...

Code Block
languagexml
titleSample Request for addNote
{
	"apiUrl":"https://wso2yasho.freshdesk.com",
	"apiKey":"SODsQllHr0NicsiRpRWw",
  	"apiVersion": "v2"
}

 

Anchor
deleteTicket
deleteTicket
Deletes a particular ticket

...

Code Block
languagexml
titleSample Request for deleteTicket
{
	"apiUrl":"https://wso2yasho.freshdesk.com",
	"apiKey":"SODsQllHr0NicsiRpRWw",
	"apiVersion": "v2",
	"ticketId":"38"
}

 

Anchor
createTicket
createTicket
Creating a ticket

...

Code Block
languagexml
titlecreateTicket
<freshdesk.createTicket>
    <requesterId>{$ctx:requesterId}</requesterId>
    <email>{$ctx:email}</email>
    <facebookId>{$ctx:facebookId}</facebookId>
    <phone>{$ctx:phone}</phone>
    <twitterId>{$ctx:twitterId}</twitterId>
    <name>{$ctx:name}</name>
    <subject>{$ctx:subject}</subject>
    <type>{$ctx:type}</type>
    <status>{$ctx:status}</status>
    <priority>{$ctx:priority}</priority>
    <customFields>{$ctx:customFields}</customFields>
    <description>{$ctx:description}</description>
    <responderId>{$ctx:responderId}</responderId>
    <ccEmails>{$ctx:ccEmails}</ccEmails>
    <dueBy>{$ctx:dueBy}</dueBy>
    <emailConfigId>{$ctx:emailConfigId}</emailConfigId>
    <frDueBy>{$ctx:frDueBy}</frDueBy>
    <groupId>{$ctx:groupId}</groupId>
    <productId>{$ctx:productId}</productId>
    <source>{$ctx:source}</source>
    <tags>{$ctx:tags}</tags>
</freshdesk.createTicket>
Properties
  • customFields: Pre-defined custom fields as a JSON Object.
  • status: The status of the ticket.
  • subject: The subject of the ticket.
  • emailConfigId: The ID of the email configuration that is used for this ticket.
  • requesterId: The ID of the requester. For existing contacts, requesterId can be passed instead of email.
  • groupId: The ID of the group to which the ticket is assigned.
  • source: The channel through which the ticket was created.
  • email: The email address of the requester. If no contact exists with this email address in FreshDesk, it will be added as a new contact.
  • type: The type of the particular ticket.
  • description: Plain text content of the ticket.
  • priority: The priority of the ticket.
  • ccEmails: The email address specified in the "cc" field of the incoming ticket email.
  • responderId: The ID of the agent to whom the ticket is assigned.
  • name: Name of the requester
  • facebookId: Facebook ID of the requester. If no contact exists with this facebook_id, then a new contact will be created.
  • phone: Phone number of the requester. If no contact exists with this phone number in Freshdesk, it will be added as a new contact. If the phone number is set and the email address is not, then the name attribute is mandatory.
  • twitterId: Twitter handle of the requester. If no contact exists with this handle in Freshdesk, it will be added as a new contact.
  • dueBy: Timestamp that denotes when the ticket is due to be resolved
  • productId: ID of the product to which the ticket is associated. It will be ignored if the email_config_id attribute is set in the request.
  • tags: Tags that have been associated with the ticket
Sample request

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

Code Block
languagexml
titleSample Request for createTicket
{
  "apiUrl": "https://wso2yasho.freshdesk.com",
  "apiKey": "SODsQllHr0NicsiRpRWw",
  "apiVersion": "SODsQllHr0NicsiRpRWwv2",
  "requesterId": "19000247627",
  "email": "testTicket@gmail.com",
  "facebookId": "",
  "phone": "01112214567",
  "twitterId": "twitter",
  "name": "RequesterName",
  "description": "Creating Ticket",
  "subject": "testSubject",
  "emailConfigId": "",
  "frDueBy": "2016-10-03T12:15:00Z",
  "groupId": "19000023144",
  "productId": "19000000166",
  "source": "",
  "type": "issue",
  "responderId": "",
  "attachments": "",
  "ccEmails": [
    "yyyt@gmail.com",
    "ttty@gmail.com"
  ],
  "customFields": {
    "z": "tttttest"
  },
  "dueBy": "2016-10-03T12:15:00Z",
  "priority":1,
  "status": 2
}

...

Code Block
languagexml
titlegetTicket
<freshdesk.getTicket>
    <ticketId>{$ctx:ticketId}</ticketId>
</freshdesk.getTicket>
Properties
  • ticketId: Required - The unique identifier of the ticket specific to the account.

...

Code Block
languagexml
titleSample Request for getTicket
{
	"apiUrl": "https://wso2yasho.freshdesk.com",
    "apiKey": "SODsQllHr0NicsiRpRWw",
	"apiVersion":    "v2",
	"ticketId":"1"
}

 

Anchor
listTickets
listTickets
Retrieving a list of tickets

...

  • page: The requested page number.
  • email:  The email address.
  • requesterId:  The ID of the requester. For existing contacts, requesterId can be passed instead of email.
  • updatedSince: The ticket updated since a specific timestamp.
  • companyId:  The unique identifier of the company.
  • predefinedFilters:  The various filters available are new_and_my_openwatchingspamdeleted.
  • orderBy:  Default sort order is created_at
  • include:When getting list of tickets, will get some specific details mentioned here.
  • orderType: Default sort order type is desc.
Sample request

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

Code Block
languagexml
titleSample Request for listTickets
{
  "apiUrl": "https://wso2yasho.freshdesk.com",
  "apiKey": "SODsQllHr0NicsiRpRWw",
  "apiVersion": "v2",
  "predefinedFilters": "watching",
  "requesterId": "19000104481",
  "updatedSince": "",
  "companyId": "",
  "email": "test@gmail.com",
  "orderBy": "",
  "orderType": "desc",
  "include": "requester"
}

 

Anchor
updateTicket
updateTicket
Updating a ticket

...

Code Block
languagexml
titleupdateTicket
<freshdesk.updateTicket>
    <ticketId>{$ctx:ticketId}</ticketId>
    <requesterId>{$ctx:requesterId}</requesterId>
    <email>{$ctx:email}</email>
    <facebookId>{$ctx:facebookId}</facebookId>
    <phone>{$ctx:phone}</phone>
    <twitterId>{$ctx:twitterId}</twitterId>
    <name>{$ctx:name}</name>
    <subject>{$ctx:subject}</subject>
    <type>{$ctx:type}</type>
    <status>{$ctx:status}</status>
    <priority>{$ctx:priority}</priority>
    <customFields>{$ctx:customFields}</customFields>
    <description>{$ctx:description}</description>
    <responderId>{$ctx:responderId}</responderId>
    <ccEmails>{$ctx:ccEmails}</ccEmails>
    <dueBy>{$ctx:dueBy}</dueBy>
    <emailConfigId>{$ctx:emailConfigId}</emailConfigId>
    <frDueBy>{$ctx:frDueBy}</frDueBy>
    <groupId>{$ctx:groupId}</groupId>
    <productId>{$ctx:productId}</productId>
    <source>{$ctx:source}</source>
    <tags>{$ctx:tags}</tags>
</freshdesk.updateTicket>
Properties
  • customFields: Pre-defined custom fields as a JSON Object.
  • status: The status of the ticket.
  • ticketId: Required - The unique identifier of the ticket specific to the account.
  • subject: The subject of the ticket.
  • emailConfigId: The ID of the email configuration that is used for this ticket.
  • requesterId: The ID of the requester. For existing contacts, requesterId can be passed instead of email.
  • groupId: The ID of the group to which the ticket is assigned.
  • source: The channel through which the ticket was created.
  • email: The email address of the requester. If no contact exists with this email address in FreshDesk, it will be added as a new contact.
  • type: The type of the particular ticket.
  • description: Plain text content of the ticket.
  • priority: The priority of the ticket.
  • ccEmails: The email address specified in the "cc" field of the incoming ticket email.
  • responderId: The ID of the agent to whom the ticket is assigned.
  • name: Name of the requester
  • facebookId: Facebook ID of the requester. If no contact exists with this facebook_id, then a new contact will be created.
  • phone: Phone number of the requester. If no contact exists with this phone number in Freshdesk, it will be added as a new contact. If the phone number is set and the email address is not, then the name attribute is mandatory.
  • twitterId: Twitter handle of the requester. If no contact exists with this handle in Freshdesk, it will be added as a new contact.
  • dueBy: Timestamp that denotes when the ticket is due to be resolved
  • productId: ID of the product to which the ticket is associated. It will be ignored if the email_config_id attribute is set in the request.
  • tags: Tags that have been associated with the ticket
 
Info
titleNote

When you use the updateTicket operation, you need to pass " " if you need to clear the value of any field.

Sample request

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

Code Block
languagexml
titleSample Request for updateTicket
{
  "apiUrl": "https://wso2yasho.freshdesk.com.freshdesk.com",
  "apiKey": "SODsQllHr0NicsiRpRWw",
  "apiKeyapiVersion": "SODsQllHr0NicsiRpRWwv2",
  "ticketId":"1",
  "requesterId": 19000247627,
  "email": "testTicket@gmail.com",
  "facebookId": "",
  "phone": "",
  "twitterId": "twitter",
  "name": "RequesterName",
  "description": "Creating Ticket",
  "subject": "testSubject",
  "emailConfigId": "",
  "frDueBy": "",
  "groupId": "",
  "productId": "",
  "source": "",
  "type": "issue",
  "responderId": "",
  "attachments": "",
  "ccEmails": [
    "yyyt@gmail.com",
    "ttty@gmail.com"
  ],
  "customFields": {
    "z": "tttt"
  },
  "dueBy": "",
  "priority":1,
  "status": 2
}

...

Code Block
languagexml
titleSample Proxy
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="freshdesk_createTicket"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence onError="faultHandlerSeq">
         <property expression="json-eval($.apiUrl)" name="apiUrl"/>
         <property expression="json-eval($.apiKey)" name="apiKey"/>
		 <property expression="json-eval($.apiVersion)" name="apiVersion"/>
     <property 		 <property expression="json-eval($.requesterId)" name="requesterId"/>
         <property expression="json-eval($.facebookId)" name="facebookId"/>
         <property expression="json-eval($.email)" name="email"/>
         <property expression="json-eval($.twitterId)" name="twitterId"/>
         <property expression="json-eval($.phone)" name="phone"/>
         <property expression="json-eval($.name)" name="name"/>
         <property expression="json-eval($.subject)" name="subject"/>
         <property expression="json-eval($.type)" name="type"/>
         <property expression="json-eval($.status)" name="status"/>
         <property expression="json-eval($.priority)" name="priority"/>
         <property expression="json-eval($.description)" name="description"/>
         <property expression="json-eval($.responderId)" name="responderId"/>
         <property expression="json-eval($.attachments)" name="attachments"/>
         <property expression="json-eval($.ccEmails)" name="ccEmails"/>
         <property expression="json-eval($.customFields)" name="customFields"/>
         <property expression="json-eval($.dueBy)" name="dueBy"/>
         <property expression="json-eval($.emailConfigId)" name="emailConfigId"/>
         <property expression="json-eval($.groupId)" name="groupId"/>
         <property expression="json-eval($.productId)" name="productId"/>
         <property expression="json-eval($.source)" name="source"/>
		 <property name="tags" expression="json-eval($.tags)"/> <freshdesk.init>
            <apiUrl>{$ctx:apiUrl}</apiUrl>
            <apiKey>{$ctx:apiKey}</apiKey>
         			<apiVersion>{$ctx:apiVersion}</apiVersion>
		</freshdesk.init>
        <freshdesk.createTicket>
    		<requesterId>{$ctx:requesterId}</requesterId>
   			<email>{$ctx:email}</email>
    		<facebookId>{$ctx:facebookId}</facebookId>
    		<phone>{$ctx:phone}</phone>
    		<twitterId>{$ctx:twitterId}</twitterId>
    		<name>{$ctx:name}</name>
    		<subject>{$ctx:subject}</subject>
    		<type>{$ctx:type}</type>
    		<status>{$ctx:status}</status>
    		<priority>{$ctx:priority}</priority>
    		<customFields>{$ctx:customFields}</customFields>
    		<description>{$ctx:description}</description>
    		<responderId>{$ctx:responderId}</responderId>
    		<ccEmails>{$ctx:ccEmails}</ccEmails>
    		<dueBy>{$ctx:dueBy}</dueBy>
    		<emailConfigId>{$ctx:emailConfigId}</emailConfigId>
    		<frDueBy>{$ctx:frDueBy}</frDueBy>
    		<groupId>{$ctx:groupId}</groupId>
    		<productId>{$ctx:productId}</productId>
    		<source>{$ctx:source}</source>
    		<tags>{$ctx:tags}</tags>
		</freshdesk.createTicket>
         <respond/>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>
   </target>
   <description/>
</proxy>