I know that there is no pagination, and you get 100 items per request, so I try to use the before and after to get tasks that were modified between two dates.
I don’t anything returned, unless I specify the last 24 hours (it returns the full 100 tickets).
If I modify the query to use anything else, it returns nothing for my project and that project has many changes done every day.
It’s not working when using the API browser. This is the curl request it generates. If I change the before to the 21st, or the 22nd, I get a 100 items … but the 20th or anything before that gets nothing.
curl --request GET
–url ‘https://app.asana.com/api/1.0/workspaces//tasks/search?projects.any=&modified_on.before=2025-01-20&modified_on.after=2025-01-15&sort_by=modified_at&sort_ascending=false’
–header ‘accept: application/json’
–header ‘authorization: Bearer shhhh!’
The way I paginate is by asking for things created before a certain date → I get 100 results → get the last creation date → ask again for things before that date → all walk backwards this way. It works well. Not sure why your doesn’t work though… @Phil_Seeman any idea?
No, I’m baffled why it’s not working. I just tried it in Postman and it worked properly for me using parameters like are shown here.
Have you tried simplifying the query just for testing purposes - removing the sort_by parameter, using a different project gid, doing just a modified_on.before but no modified_on.after - things like that? Just to see if any of it makes a difference.
it’s still the case for me ![:frowning: :frowning:](https://emoji.discourse-cdn.com/twitter/frowning.png?v=12)
I tried it with a few projects, it consistently giving me only the last 24 hours of modified tickets.
I removed any sorting
Will that depend on an ASANA subscription type, or user specific permissions? I am using my key for this.
curl --request GET
–url ‘https://app.asana.com/api/1.0/workspaces/worspaceid/tasks/search?projects.any=projeid&modified_on.before=2025-01-20&modified_on.after=2024-12-31’
–header ‘accept: application/json’
–header ‘authorization: Bearer shhh’
@John_Baldo @AndrewWong maybe you can take a look at this?