New View filter API

Hi,
I would like to filter all my tickets in a specific way.
I’ve added a ‘New View’ on the dashboard and need to use it in my API endpoint, but I don’t see the right way to use it.
Is it at all possible to put my custom view as a parameter in the API request to see the tickets?
Thanks

Hi @Hubert_Bokszczanin

Welcome to the Freshworks Developer Community…! :handshake:

You can use the Ticket filter API to achieve this.I hope this helps

Hi, Yes, but can i set up ‘created_at’ parameter as ‘Any time’ ? To achieve the same result of filtering as i have on dashboard ?

Hello @Hubert_Bokszczanin

No, You can’t set ‘created_at’ as ‘Ant time’ because it’s a date filed the value must be a date, not a string.

example

created_at:‘2024-11-14’

Okey, so is there any way to filter out all my tickets from specific group id

I have this set:

‘https://{domain}.freshdesk.com/api/v2/search/tickets?query=“group_id:{CS}”’

and i need to get all tickets from this group id but from response i got only 30 where on dashboard i have almost 5k of tickets,

Hi @Hubert_Bokszczanin

You must add pagination to your API request. So that you can retrieve all the tickets based on ‘group_id’

Thank You, one more question, there is parameter ‘updated_since=2015-01-19T02:00:00Z’ but it does not response anything when i requested it.

Could You check if there is something wrong ?

‘https://{domain}.freshdesk.com/api/v2/search/tickets?updated_since=2024-01-19’

Hi @Hubert_Bokszczanin

I haven’t seen the ‘updated_since’ field in filter API documentation instead I have seen ‘updated_at’. Can you recheck those details in that documentation?

If it is ‘updated_at’ the URL must be

'https://{domain}.freshdesk.com/api/v2/search/tickets?query="updated_at:%272024-11-14%27"'

If you want to list the tickets based on the ‘updated_since’ the URL should be

'https://{domain}.freshdesk.com/api/v2/tickets?updated_since=2024-11-14T02:00:00Z'

Here is example with updated_since param

Yes @Hubert_Bokszczanin

Can you try the same? If you get any error response please let me know.

Yes, i have this error:

Failed to fetch tickets: 400 - {“description”:“Validation failed”,“errors”:[{“field”:“updated_since”,“message”:“Unexpected/invalid field in request”,“code”:“invalid_field”}]}

Can you share the URL that you used to make the API request

sure, i use this url for tickets and it works, with groupe_id query too bu with this param it does not.

f’https://{domain}.freshdesk.com/api/v2/search/tickets?updated_since=2024-10-10’

Can you try this

https://{domain}.freshdesk.com/api/v2/tickets?updated_since=2024-11-14T02:00:00Z

Note:
In the above URL, I have used a dummy date in UTC format

1 Like

Thank You it works, :slight_smile:

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.