How to filter tickets by date with time in query in 'created_at'?

Hi all,
I am tried filter tickets by created at in date with time ,

but cannot filter me, it is possible .

how to fixed it

Hello @Annalakshmi_Manivasa

First of all, welcome to the community :tada: , and thank you for reaching out!

I don’t believe the Filter Tickets API supports query parameters for created_date of type DateTime (yyyy-mm-ddTHH:MM:ss). Can you please try your request once again without the time appended to the created_at parameter? I believe the error message you have received in your response is also calling out the same.

Let us know how it goes! All the best.

1 Like

Hi,

it is possible for filter tickets are datetime using query ‘ex: (yyyy-mm-ddTHH:MM:ss)’?

Hello Annalakshmi, based on what the API reference for Filter Tickets calls out, this not currently supported.

If you are OK to use the updated-time instead of created date, you can use the List Tickets API and provide a full timestamp. I hope this fulfils your need somehow.

If this does not work, can you expand on the use-case to help appreciate if there is a workaround someone could offer?

Hi @Annalakshmi_Manivasa,

Please try putting single quotes around the date value. This should work:

GET /api/v2/search/tickets?query="created_at:>'2022-01-01'" HTTP/1.1

hi Kaustav Das Modak,

we have tried this is already, if my question is this api "/api/v2/search/tickets?query=“created_at:>‘2022-01-01’” use filter 10 pages only not exceed above for EX:

how to solve pagination?

Looks like that is a limitation of the API endpoint. This is mentioned in the “Note” section of the Filter Tickets API docs:

To scroll through the pages add page parameter to the url. The page number starts with 1 and should not exceed 10

An alternative, as @satwik mentioned above, is to use the List All Tickets endpoint, sort by created_at and keep on fetching a list of all tickets that the API can provide. You will want to stagger that call to make sure that you do not hit REST API rate limits. If you are using this in a Freshworks app, you can use scheduled functions to keep calling the endpoint.