Each ticket has distinct properties e.g. status (open/closed e.t.c.), source (via Email/Forum e.t.c.). Below are the ticket properties which have fixed values:
| 1 | |
| Portal | 2 |
| Phone | 3 |
| Forum | 4 |
| 5 | |
| 6 | |
| Chat | 7 |
| Open | 2 |
| Pending | 3 |
| Resolved | 4 |
| Closed | 5 |
| Low | 1 |
| Medium | 2 |
| High | 3 |
| Urgent | 4 |
Below is a sample GET request for viewing all the tickets
curl -u {username}:{password}
http://{yourhelpdesk.freshdesk.com}/helpdesk/tickets.xml
Below is a sample GET request for reading all the tickets from a user
curl -u {username}:{password}
http://{yourhelpdesk.freshdesk.com}/helpdesk/tickets/user_ticket.xml?email=
{yourcustomer@company.com}
Below is the sample output for the above request. Use the tables above to know the ticket properties e.g. below code has
<helpdesk-tickets type="array"> <helpdesk-ticket> <account-id type="integer">1</account-id> <cc-email type="yaml" nil="true"></cc-email> <created-at type="datetime">2011-03-29T12:17:01+05:30</created-at> <deleted type="boolean">false</deleted> <delta type="boolean">true</delta> <description>This is a sample ticket, feel free to delete it.</description> <display-id type="integer">1</display-id> <due-by type="datetime">2011-04-08T12:16:59+05:30</due-by> <email-config-id type="integer" nil="true"></email-config-id> <frDueBy type="datetime">2011-04-01T09:16:59+05:30</frDueBy> <fr-escalated type="boolean">false</fr-escalated> <group-id type="integer" nil="true"></group-id> <id type="integer">1</id> <isescalated type="boolean">false</isescalated> <owner-id type="integer" nil="true"></owner-id> <priority type="integer">1</priority> <requester-id type="integer">1</requester-id> <responder-id type="integer">1</responder-id> <source type="integer">2</source> <spam type="boolean">false</spam> <status type="integer">2</status> <subject>This is a sample ticket</subject> <ticket-type type="integer">Question</ticket-type> <to-email nil="true"></to-email> <trained type="boolean">false</trained> <updated-at type="datetime">2011-03-29T12:17:01+05:30</updated-at> <urgent type="boolean">false</urgent> </helpdesk-ticket> </helpdesk-tickets>
Below is a sample POST request for creating a ticket
curl -u {username}:{password} test -H "Content-Type: application/xml" -d
“<helpdesk_ticket><description>{Disk failure problem}</description>
<email>{yourcustomer@customercompany.com}</email>
<custom_field><field_name>{value}</field_name></custom_field>
</helpdesk_ticket>" -X POST
http://{yourhelpdesk.freshdesk.com}/helpdesk/tickets.xml
Below is a sample GET request for viewing all the Ticket Fields
curl -u {username}:{password} http://{yourhelpdesk.freshdesk.com}/ticket_fields.xml
Below is the sample request. For creating the new ticket you need to use name field
<helpdesk-ticket-fields> . . . <helpdesk-ticket-field> <active type="boolean">true</active> <created-at type="datetime">2011-11-12T00:42:04+05:30</created-at> <description/> <editable-in-portal type="boolean">true</editable-in-portal> <field-type>custom_number</field-type> <flexifield-def-entry-id type="integer">1</flexifield-def-entry-id> <id type="integer">11</id> <label>Api Number</label> <label-in-portal>Api Number</label-in-portal> <name>api_number_1</name> <position type="integer">10</position> <required type="boolean">false</required> <required-for-closure type="boolean">false</required-for-closure> <required-in-portal type="boolean">false</required-in-portal> <updated-at type="datetime">2011-11-12T00:42:05+05:30</updated-at> <visible-in-portal type="boolean">true</visible-in-portal> <choices></choices> </helpdesk-ticket-field> </helpdesk-ticket-fields>