API - list tickets using filter without spam or deleted

  • 16 November 2018
  • 1 reply
  • 78 views

I need some help working with the API. I want to show the total amount of tickets that are not assigned to either an agent or group and have the open status.


So I got it working already but it also shows all the tickets that are either marked as spam or deleted. I am using the following query in a PHP script:


"https://$yourdomain.freshdesk.com/api/v2/search/tickets?query=\"group_id:null%20AND%20agent_id:null%20AND%20status:2\""


What would I need to add to NOT show tickets marked as spam or that are deleted?


Any help is appreciated!





This topic has been closed for comments

1 reply

So I have discovered that only the "total" value was incorrect that Freshdesk was giving me back with the above string. So I have now used the count function in PHP to get the right results.