How to get user tasks for the specified period?


#1

Hello!
How to get user tasks for the specified period?


#2

https://app.asana.com/api/1.0/tasks?opt_fields=name,due_on&workspace=28590171810654&assignee=39856396021971&completed=false&completed_since=2018-08-21&limit=1


#3

@romankondratev, thanks for reaching out. The easiest way to get tasks within a specific date range is by using the Search API. For example:

https://app.asana.com/api/1.0/workspaces/123456789/tasks/search?assignee.any=me&completed=false&due_on.before=2018-08-19&due_on.after=2018-01-19?limit=10

Note that the Search API is a premium feature. To do this as a free user, I suggest fetching tasks and then doing some client side filtering for your desired date range. You can get all incomplete tasks fairly easily by specifying completed_since=now or you can put in a date range to get tasks that have been completed since a certain time. Here are the docs for task queries not using the search endpoint.


#4

Thank you!