Searching Items by created_at time span

Hello,

I am in the midst of API integration, i came across a doubt regarding the items. Is it possible to search for items in a board that have been created during the following day of from a timespan?

Thank you!

Hello @raimund.reisinger and welcome to the community!

I hope you like it here :muscle:

There are no arguments for that. But you could use the created_at field from the item to get the date of creation of each one and then sort them on your end.

Hope that helps :slightly_smiling_face:

Cheers,
Matias

Thank you for the reply Matias.

However, is there any way I could only fetch the new or updated items so that i don’t have to request all the items every time i sync it with our Data Warehouse?

Thank you!

Hi @raimund.reisinger!

One way to achieve this would be to use the newest_first argument in your Items query. See argument list here.

This would get you the newest items. In order to prevent the query from pulling all your items, you can add the limit argument.

Thank you for the help @alessandra!

But even if i were to use the newest_first argument in my items query, how would I know that I have pulled all the latest ones and not have duplicates?

Thank you!

@raimund.reisinger

No problem!

One way to get around having duplicate values synced to your data warehouse would be to check query for the created_at field in your query. With this field, you can then exclude any items that have been created outside of the desired time period.

More on the created_at field can be found here: Items

I hope this helps! :slight_smile:

@alessandra!

But wouldn’t that incur more processing and bandwidth from both ends?

Thanks

Hello @raimund.reisinger!

If you want to query for the items that were created between two moments in time only, you will have to go with the solution that Alessandra provided. There is no argument in our API to filter the items by creation date when querying.

You can use pagination, get the created_at field from your items, and not return any more items once the desired date is shown in the created_at of the items in the response.

Hope that helps!

Cheers,
Matias