Misleading API documentation for /api/v2/search/tickets

  • 12 February 2019
  • 10 replies

I'm looking at the API documentation for filtering tickets here: https://developer.freshdesk.com/api/#filter_tickets

Under the highlighted 'notes' section, it states:

1. Archived tickets will not be included in the results
2. The query must be URL encoded
3. Query can be framed using the name of the ticket fields, which can be obtained from Ticket Fields endpoint. Ticket Fields are case sensitive

If I look at the Ticket Fields endpoint as suggested, I see that 'description' is listed as a valid ticket field. However, if I try the following query I get an invalid field error:

curl -v -u "${API_KEY}":X -X GET 'https://bitx.freshdesk.com/api/v2/search/tickets?query="description:%27Test%27"'

{"description":"Validation failed","errors":[{"field":"description","message":"Unexpected/invalid field in request","code":"invalid_field"}]}

10 replies

I have the same problem with our custom ticket field Project that according to /ticket_fields would be 'project'. When I add this field to the query it gives me the same error

Userlevel 4
Badge +12

@Guy Description is not supported in the Filter tickets API as a query param. Right below the Note section, you'll find the list of supported default fields.

@Allard Using custom ticket fields should work as intended. Can you please share the query that you're trying to use?


Userlevel 4
Badge +12

@Allard Can you please change the query to include cf_project (to indicate that it's a custom field) and see if this works?


I already tried that before. I get the same error:

{ field: 'cf_project',

  message: 'Unexpected/invalid field in request',

  code: 'invalid_field' }

Userlevel 4
Badge +12

@Allard Seems like a bug with the usage of single line text field in the filter tickets API. We can do a quick fix to make this work for your account.


Badge +2

Hello - Arravind, can you please make a quick fix on my account.  I'm experiencing the same issue.

Thank you


Hello @Arravind has this been fixed to all accounts?

I am having the same problem on my account.  I am trying to search for a field called cf_orderid, I have also tried a customer number field and it does not work either.


@allardis this currently working for you?