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.
Operation | Description |
---|---|
Retrieves a list of tickets' fields. | |
deleteTicket | Deletes a particular ticket. |
createTicket | Creates a new ticket in your help desk. |
getTicket | Retrieves a particular ticket. |
listTickets | Retrieves a list of tickets. |
updateTicket | Updates a particular ticket. |
Operation details
This section provides further details on the operations related to tickets.
Retrieves a list of tickets' fields.
The listTicketFields operation retrives a list of ticket's fields.
<freshdesk.listTicketFields/>
Sample request
Following is a sample REST/JSON request that can be handled by the listTicketFields operation.
{ "apiUrl":"https://wso2yasho.freshdesk.com", "apiKey":"SODsQllHr0NicsiRpRWw" }
Deletes a particular ticket
The
operation deletes a particular ticket.deleteTicket
<freshdesk.deleteTicket> <ticketId>{$ctx:ticketId}</ticketId> </freshdesk.deleteTicket>
Properties
ticketId:
Sample request
Following is a sample REST/JSON request that can be handled by the delete
operation.Ticket
{ "apiUrl":"https://wso2yasho.freshdesk.com", "apiKey":"SODsQllHr0NicsiRpRWw", "ticketId":"38" }
Creating a ticket
The
peration creates a new ticket in your help desk.createTicket o
<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:
status:
subject:
emailConfigId:
requesterId:
requesterId
can be passed instead ofemail
.groupId:
source:
email:
type:
description:
priority:
ccEmails:
responderId:
: Name of the requestername
: Facebook ID of the requester. If no contact exists with this facebook_id, then a new contact will be created.facebookId
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
operation.createTicket
{ "apiUrl": "https://wso2yasho.freshdesk.com", "apiKey": "SODsQllHr0NicsiRpRWw", "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 }
Retrieving a ticket
The
operation retrieves a particular ticket.getTicket
<freshdesk.getTicket> <ticketId>{$ctx:ticketId}</ticketId> </freshdesk.getTicket>
Properties
ticketId
Required - The unique identifier of the ticket specific to the account.:
Sample request
Following is a sample REST/JSON request that can be handled by the
operation.getTicket
{ "apiUrl": "https://wso2yasho.freshdesk.com", "apiKey": "SODsQllHr0NicsiRpRWw", "ticketId":"1" }
Retrieving a list of tickets
The
operation retrieves a list of tickets.listTickets
<freshdesk.listTickets> <predefinedFilters>{$ctx:predefinedFilters}</predefinedFilters> <requesterId>{$ctx:requesterId}</requesterId> <updatedSince>{$ctx:updatedSince}</updatedSince> <companyId>{$ctx:companyId}</companyId> <email>{$ctx:email}</email> <page>{$ctx:page}</page> <orderBy>{$ctx:orderBy}</orderBy> <orderType>{$ctx:orderType}</orderType> <include>{$ctx:include}</include> </freshdesk.listTickets>
Properties
page:
The requested page number.email:
The email address.requesterId:
The ID of the requester. For existing contacts,requesterId
can be passed instead ofemail
.updatedSince:
The ticket updated since a specific timestamp.companyId:
The unique identifier of the company.predefinedFilters:
The various filters available are new_and_my_open, watching, spam, deleted.orderBy:
Default sort order is created_atinclude: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
operation.listTickets
{ "apiUrl":"https://virtusaabc.freshdesk.com", "apiKey":"93YthfomLWOf53rxlNgw", "format":"json", "filterType":"requesteremail", "email":"sanver@virtusa.com", "filterName":"all_tickets", "requesterId":"", "viewId":"", "companyName":"", "companyId":"", "page":"1" }
Additional Note
- The
filterType
parameter can be omitted if you want to retrieve a list of all the tickets without filtering. - The API supports a list of endpoints. These endpoints are supported in the connector as described below.
# | Parameter Name | filterType | API Endpoint | filterName |
1 | requesterId | requester | /helpdesk/tickets/filter/requester/[requester_id]?format=json | Applicable |
2 | viewId | customticketviews | /helpdesk/tickets/view/[view_id]?format=json | Not Applicable |
3 | companyName | companyname | /helpdesk/tickets.json?company_name=[name] | Applicable |
4 | companyId | companyid | /helpdesk/tickets.json?company_id=[id] | Applicable |
5 | requesteremail | /helpdesk/tickets.json?email=[email] | Applicable | |
6 | filterName | defaultfilters | /helpdesk/tickets/filter/[filter_name]?format=json | Applicable |
7 | Not required | (Omit) | /helpdesk/tickets.json | Not Applicable |
- For all
filterType
values exceptdefaultfilters
, thefilterName
" property can be provided as an optional filter. However, when thefilterType
value isdefaultfilters
, thefilterName
property is mandatory.
Related FreshDesk documentation
http://freshdesk.com/api#view_all_ticket
Updating a ticket
The updateTicket operation updates a particular ticket.
<freshdesk.updateTicket> <customField>{$ctx:customField}</customField> <status>{$ctx:status}</status> <ownerId>{$ctx:ownerId}</ownerId> <urgent>{$ctx:urgent}</urgent> <subject>{$ctx:subject}</subject> <delta>{$ctx:delta}</delta> <emailConfigId>{$ctx:emailConfigId}</emailConfigId> <requesterId>{$ctx:requesterId}</requesterId> <deleted>{$ctx:deleted}</deleted> <productId>{$ctx:productId}</productId> <isEscalated>{$ctx:isEscalated}</isEscalated> <groupId>{$ctx:groupId}</groupId> <toEmails>{$ctx:toEmails}</toEmails> <ticketId>{$ctx:ticketId}</ticketId> <source>{$ctx:source}</source> <frEscalated>{$ctx:frEscalated}</frEscalated> <priority>{$ctx:priority}</priority> <ticketType>{$ctx:ticketType}</ticketType> <responderId>{$ctx:responderId}</responderId> <trained>{$ctx:trained}</trained> <spam>{$ctx:spam}</spam> </freshdesk.updateTicket>
Properties
customField:
Pre-defined custom fields as a JSON Object.status:
The status of the ticket.ownerId:
The ID of the owner.urgent:
Set totrue
if the ticket is urgent.subject:
The subject of the ticket.delta:
Set to eithertrue
orfalse
.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 ofemail
.deleted:
Set totrue
if the ticket is deleted.productId:
The ID of the product.isEscalated:
Set totrue
if an escalation was sent.groupId:
The ID of the group to which the ticket is assigned.toEmails:
The email address to which the incoming ticket email is sent.ticketId:
The unique ID of the ticket.frEscalated:
Set to eithertrue
orfalse
.priority:
The priority of the ticket.ticketType:
The type of the particular ticket.responderId:
The ID of the agent to whom the ticket is assigned.trained:
Set to eithertrue
orfalse
.spam:
Set totrue
if the ticket is marked as spam.
Note
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
operation.updateTicket
{ "apiUrl":"https://virtusaabc.freshdesk.com", "apiKey":"93YthfomLWOf53rxlNgw", "format":"json", "ticketId":"228", "customField":"{}", "status":"", "ownerId":"", "urgent":"", "subject":"", "delta":"", "emailConfigId":"", "requesterId":"", "deleted":"", "productId":"", "isEscalated":"", "groupId":"", "toEmails":"", "source":"", "frEscalated":"true", "priority":"4", "ticketType":"fdsf", "responderId":" ", "trained":"true", "spam":"" }
Related FreshDesk documentation
http://freshdesk.com/api#update_ticket_priority
Sample configuration
Following is a sample proxy service that illustrates how to connect to FreshDesk with the init
operation and use the addNote
operation. The sample request for this proxy can be found in addNote sample request. You can use this sample as a template for using other operations in this category.
<proxy xmlns="http://ws.apache.org/ns/synapse" name="freshdesk_updateTicket" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence onError="faultHandlerSeq"> <property name="apiUrl" expression="json-eval($.apiUrl)"/> <property name="format" expression="json-eval($.format)"/> <property name="apiKey" expression="json-eval($.apiKey)"/> <property name="customField" expression="json-eval($.customField)"/> <property name="status" expression="json-eval($.status)"/> <property name="ownerId" expression="json-eval($.ownerId)"/> <property name="urgent" expression="json-eval($.urgent)"/> <property name="subject" expression="json-eval($.subject)"/> <property name="delta" expression="json-eval($.delta)"/> <property name="emailConfigId" expression="json-eval($.emailConfigId)"/> <property name="requesterId" expression="json-eval($.requesterId)"/> <property name="deleted" expression="json-eval($.deleted)"/> <property name="productId" expression="json-eval($.productId)"/> <property name="isEscalated" expression="json-eval($.isEscalated)"/> <property name="groupId" expression="json-eval($.groupId)"/> <property name="toEmails" expression="json-eval($.toEmails)"/> <property name="ticketId" expression="json-eval($.ticketId)"/> <property name="source" expression="json-eval($.source)"/> <property name="frEscalated" expression="json-eval($.frEscalated)"/> <property name="priority" expression="json-eval($.priority)"/> <property name="ticketType" expression="json-eval($.ticketType)"/> <property name="responderId" expression="json-eval($.responderId)"/> <property name="trained" expression="json-eval($.trained)"/> <property name="spam" expression="json-eval($.spam)"/> <freshdesk.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <format>{$ctx:format}</format> <apiKey>{$ctx:apiKey}</apiKey> </freshdesk.init> <freshdesk.updateTicket> <customField>{$ctx:customField}</customField> <status>{$ctx:status}</status> <ownerId>{$ctx:ownerId}</ownerId> <urgent>{$ctx:urgent}</urgent> <subject>{$ctx:subject}</subject> <delta>{$ctx:delta}</delta> <emailConfigId>{$ctx:emailConfigId}</emailConfigId> <requesterId>{$ctx:requesterId}</requesterId> <deleted>{$ctx:deleted}</deleted> <productId>{$ctx:productId}</productId> <isEscalated>{$ctx:isEscalated}</isEscalated> <groupId>{$ctx:groupId}</groupId> <toEmails>{$ctx:toEmails}</toEmails> <ticketId>{$ctx:ticketId}</ticketId> <source>{$ctx:source}</source> <frEscalated>{$ctx:frEscalated}</frEscalated> <priority>{$ctx:priority}</priority> <ticketType>{$ctx:ticketType}</ticketType> <responderId>{$ctx:responderId}</responderId> <trained>{$ctx:trained}</trained> <spam>{$ctx:spam}</spam> </freshdesk.updateTicket> <respond/> </inSequence> <outSequence> <send/> </outSequence> </target> <description/> </proxy>