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 details
This section provides further details on the operations related to tickets.
...
The listTicketFields operation retrives a list of ticket's fields.
Code Block |
---|
language | xml |
---|
title | listTicketFields |
---|
|
<freshdesk.listTicketFields/> |
...
Following is a sample REST/JSON request that can be handled by the listTicketFields operation.
Code Block |
---|
language | xml |
---|
title | Sample Request for addNote |
---|
|
{
"apiUrl":"https://wso2yasho.freshdesk.com",
"apiKey":"SODsQllHr0NicsiRpRWw"
} |
...
The deleteTicket
operation deletes a particular ticket.
Code Block |
---|
language | xml |
---|
title | deleteTicket |
---|
|
<freshdesk.deleteTicket>
<ticketId>{$ctx:ticketId}</ticketId>
</freshdesk.deleteTicket> |
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 deleteTicket
operation.
Code Block |
---|
language | xml |
---|
title | Sample Request for deleteTicket |
---|
|
{
"apiUrl":"https://wso2yasho.freshdesk.com",
"apiKey":"SODsQllHr0NicsiRpRWw",
"ticketId":"38"
} |
...
The createTicket o
peration creates
...
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 details
This section provides further details on the operations related to tickets.
Anchor |
---|
| listTicketFields |
---|
| listTicketFields |
---|
|
Retrieves a list of tickets' fields.The listTicketFields operation retrives a list of ticket's fields.
Code Block |
---|
language | xml |
---|
title | createTicketlistTicketFields |
---|
|
<freshdesk.createTicket>
<requesterId>{$ctx:requesterId}</requesterId>
<email>{$ctx:email}</email>listTicketFields/> |
Sample requestFollowing is a sample REST/JSON request that can be handled by the listTicketFields operation.
Code Block |
---|
language | xml |
---|
title | Sample Request for addNote |
---|
|
{
"apiUrl":"https://wso2yasho.freshdesk.com",
"apiKey":"SODsQllHr0NicsiRpRWw"
} |
Deletes a particular ticketThe deleteTicket
operation deletes a particular ticket.
Code Block |
---|
language | xml |
---|
title | deleteTicket |
---|
|
<freshdesk.deleteTicket>
<facebookId><ticketId>{$ctx:facebookIdticketId}</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
...
ticketId>
</freshdesk.deleteTicket> |
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 deleteTicket
operation.
Code Block |
---|
language | xml |
---|
title | Sample Request for deleteTicket |
---|
|
{
"apiUrl":"https://wso2yasho.freshdesk.com",
"apiKey":"SODsQllHr0NicsiRpRWw",
"ticketId":"38"
} |
Creating a ticketThe createTicket o
peration creates a new ticket in your help desk.
Code Block |
---|
language | xml |
---|
title | createTicket |
---|
|
<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 requesterfacebookId
: 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 |
---|
language | xml |
---|
title | getTicket |
---|
|
<freshdesk.getTicket>
<ticketId>{$ctx:ticketId}</ticketId>
</freshdesk.getTicket> |
Properties
ticketId:
Required - The unique identifier of the ticket specific to the account.
...
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_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 listTickets
operation.
Code Block |
---|
language | xml |
---|
title | Sample Request for listTickets |
---|
|
{
"apiUrl": "https://virtusaabcwso2yasho.freshdesk.com",
"apiKey": "93YthfomLWOf53rxlNgwSODsQllHr0NicsiRpRWw",
"formatpredefinedFilters": "jsonwatching",
"filterTyperequesterId": "requesteremail19000104481",
"emailupdatedSince": "sanver@virtusa.com",
"filterNamecompanyId": "all_tickets",
"requesterIdemail": "test@gmail.com",
"viewIdorderBy": "",
"companyNameorderType": "desc",
"companyIdinclude":"", "page":"1"
} |
Info |
---|
|
- 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 | email | 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 except defaultfilters , the filterName " property can be provided as an optional filter. However, when the filterType value is defaultfilters , the filterName property is mandatory.
|
Related FreshDesk documentation
http://freshdesk.com/api#view_all_ticket
...
The updateTicket operation updates a particular ticket.
Code Block |
---|
language | xml |
---|
title | updateTicket |
---|
|
<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 to true
if the ticket is urgent.subject:
The subject of the ticket.delta:
Set to either true
or false
.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
.deleted:
Set to true
if the ticket is deleted.productId:
The ID of the product.isEscalated:
Set to true
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 either true
or false
.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 either true
or false
.spam:
Set to true
if the ticket is marked as spam.
Info |
---|
|
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 |
---|
language | xml |
---|
title | Sample Request for 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
...
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.
...
language | xml |
---|
title | Sample Proxy |
---|
...
Updating a ticketThe updateTicket operation updates a particular ticket.
Code Block |
---|
language | xml |
---|
title | updateTicket |
---|
|
<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 requesterfacebookId
: 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 |
---|
|
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 |
---|
language | xml |
---|
title | Sample Request for updateTicket |
---|
|
{
"apiUrl": "https://wso2yasho.freshdesk.com",
"apiKey": "SODsQllHr0NicsiRpRWw",
"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
}
|
Anchor |
---|
| sampleconfiguration |
---|
| sampleconfiguration |
---|
|
Sample configurationFollowing is a sample proxy service that illustrates how to connect to FreshDesk with the init
operation and use the createTicket operation. The sample request for this proxy can be found in createTicket sample request. You can use this sample as a template for using other operations in this category.
Code Block |
---|
language | xml |
---|
title | Sample 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 name="delta" expression="json-eval($.deltaapiUrl)" name="apiUrl"/>
<property name="emailConfigId" expression="json-eval($.emailConfigIdapiKey)" name="apiKey"/>
<property name="requesterId" <property expression="json-eval($.requesterId)" name="requesterId"/>
<property name="deleted" expression="json-eval($.deletedfacebookId)" name="facebookId"/>
<property name="productId" expression="json-eval($.productId)email)" name="email"/>
<property name="isEscalated" expression="json-eval($.isEscalatedtwitterId)" name="twitterId"/>
<property name="groupId" expression="json-eval($.groupId)phone)" name="phone"/>
<property name="toEmails" expression="json-eval($.toEmails)name)" name="name"/>
<property name="ticketId" expression="json-eval($.ticketIdsubject)" name="subject"/>
<property name="source" expression="json-eval($.sourcetype)" name="type"/>
<property name="frEscalated" expression="json-eval($.frEscalatedstatus)" name="status"/>
<property name="priority" expression="json-eval($.priority)" name="priority"/>
<property name="ticketType" expression="json-eval($.ticketType).description)" name="description"/>
<property name="responderId" expression="json-eval($.responderId)" name="responderId"/>
<property name="trained" expression="json-eval($.trainedattachments)" name="attachments"/>
<property name="spam" expression="json-eval($.spamccEmails)"/>
<freshdesk.init>
<apiUrl>{$ctx:apiUrl}</apiUrl> name="ccEmails"/>
<property <format>{$ctx:format}</format>expression="json-eval($.customFields)" name="customFields"/>
<property <apiKey>{$ctx:apiKey}</apiKey>
</freshdesk.init>expression="json-eval($.dueBy)" name="dueBy"/>
<freshdesk.updateTicket>
<property expression="json-eval($.emailConfigId)" name="emailConfigId"/>
<property <customField>{$ctx:customField}</customField>expression="json-eval($.groupId)" name="groupId"/>
<property <status>{$ctx:status}</status>expression="json-eval($.productId)" name="productId"/>
<property <ownerId>{$ctx:ownerId}</ownerId>
<urgent>{$ctx:urgent}</urgent>expression="json-eval($.source)" name="source"/>
<property name="tags" expression="json-eval($.tags)"/> <freshdesk.init>
<subject><apiUrl>{$ctx:subjectapiUrl}</subject>apiUrl>
<delta><apiKey>{$ctx:deltaapiKey}</delta>apiKey>
<emailConfigId>{$ctx:emailConfigId}</emailConfigId>freshdesk.init>
<freshdesk.createTicket>
<requesterId>{$ctx:requesterId}</requesterId>
<deleted> <email>{$ctx:deletedemail}</deleted>email>
<productId> <facebookId>{$ctx:productIdfacebookId}</productId>facebookId>
<phone>{$ctx:phone}</phone>
<isEscalated> <twitterId>{$ctx:isEscalatedtwitterId}</isEscalated>twitterId>
<name>{$ctx:name}</name>
<groupId> <subject>{$ctx:groupIdsubject}</groupId>subject>
<toEmails> <type>{$ctx:toEmailstype}</toEmails>type>
<ticketId> <status>{$ctx:ticketIdstatus}</ticketId>
status>
<source> <priority>{$ctx:sourcepriority}</source>priority>
<customFields>{$ctx:customFields}</customFields>
<frEscalated> <description>{$ctx:frEscalateddescription}</frEscalated>description>
<responderId>{$ctx:responderId}</responderId>
<priority> <ccEmails>{$ctx:priorityccEmails}</priority>ccEmails>
<ticketType> <dueBy>{$ctx:ticketTypedueBy}</ticketType>
dueBy>
<responderId> <emailConfigId>{$ctx:responderIdemailConfigId}</responderId>emailConfigId>
<frDueBy>{$ctx:frDueBy}</frDueBy>
<trained> <groupId>{$ctx:trainedgroupId}</trained>groupId>
<productId>{$ctx:productId}</productId>
<spam> <source>{$ctx:spamsource}</spam>source>
<tags>{$ctx:tags}</tags>
</freshdesk.updateTicket>createTicket>
<respond/>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
<description/>
</proxy> |