Skip to main content

Custom Fields in API call

  • December 25, 2013
  • 4 replies
  • 688 views


I went into the "Admin" -> "Ticket Fields" page to add 2 new fields for tickets.  I then added these fields in my REST API call to create the ticket.  Based on another thread that I saw, I layed out the XML as follows

<helpdesk_ticket>
...


<custom_field>


<custom_field_1>value</custom_field_1>

<custom_field_2>value</custom_field_2>

</custom_field>



<helpdesk_ticket>

Unfortunately, this gives me a 500 HTTP response code.  Any idea what's going on?
Did this topic help you find an answer to your question?
This topic has been closed for comments

4 replies

  • Author
  • Apprentice
  • 1 reply
  • December 25, 2013

Here is the other topic where this apparently worked: https://support.freshdesk.com/support/discussions/topics/3518



  • Contributor
  • 603 replies
  • December 30, 2013

Hi Akshay


You may follow this screenr video, which will work fine for settings Custom Fields.


You must first create a Custom Field and set a value in a Ticket and view this field label in API and the use the PUT method to set a value for this ticket or other tickets, from here after


Do check the screenr and let me know if this helps ?


https://freshdesksupport.viewscreencasts.com/042f944fb3c644c08c581c60b096013b


Thanks and regards
Vijay


  • Community Debut
  • 2 replies
  • September 11, 2014

Works well. Need to download the chrome app 'PostMan' to monitor http traffic, then do a get on the url for one of the tickets to see the actual field name for the custom field.


  • Community Debut
  • 1 reply
  • October 13, 2014

I was able to get this to work. The screencast helped. Below's a curl template that might be helpful when trying this functionality out.

curl -u YOUR_API_KEY_HERE:X -H "Content-Type: application/json" -X PUT -d '{ "helpdesk_ticket": { "foo_field_160548": "Foo" }}' 'https://domain.freshdesk.com/helpdesk/tickets/4.json'

There are multiple ways to get the name of the custom field. One is using a ticket GET. Another is using the get all ticket fields API call.