Using predefined and query filters on ticket API calls

Hi there

I’m having issues wrapping my head around using pre-defined filters (such as updated_since, per_page, etc) and custom filters (/filter?query=…) at the same time.

To my understanding, if I wanted to obtain the first 50 tickets which are all sat in one particular agent group, my URI would be:

https://mydomain.freshservice.com/api/v2/tickets?per_page=50/filter?query=“group_id:12345”

To my understanding, this should allow up to 50 tickets per page, and allow me to filter the ones I want which belong to group id 12345. However, I can’t seem to use these two filters together. Is it an either/or approach when it comes to filters like updated_since and per_page vs custom filters using queries?

It seems to work when running either of these two:

  • …/api/v2/tickets/filter?query=“group_id:12345”
  • …/api/v2/tickets?per_page=50

But not when I combine both.

Any ideas? Thanks

Hey @NatD,
I’ve shared this with the Freshservice team to help you better!

Hi @NatD,

Welcome to the community :tada:

https://mydomain.freshservice.com/api/v2/tickets?per_page=50/filter?query=“group_id:12345”

instead of this plz use the below one

https://mydomain.freshservice.com/api/v2/tickets/filter?per_page=50&query=“group_id:12345”

It’s just a matter of constricting the query params…

You have to use & if you like to add more query params to the URL…

Hope that helps :wink:

If not let me know.

Thank you.