GET completed task within the last day

tasks

#1

Hey guys.

I’m trying to figure it out how to get the completed tasks within the last day. No luck so far :frowning:

Is it even possible ? Thank you in advance.


#2

Hey @adrian_blanaru,

There are two approaches to achieve this. If you have a paid Asana account, you can use the premium /search endpoint to do server-side filtering of tasks. It works similar to advanced search in the Asana web product.

Here’s a CURL example using /search:

curl -H “Authorization: Bearer <token>” “https://app.asana.com/api/1.0/workspaces/32894/tasks/search?completed=true&assignee.any=me,other@example.com&custom_fields.8832.is_set=true&created_on.after=2018-07-15&opt_fields=name,assignee.email,completed&limit=3”

If you’re using free Asana, you will need to use the completed_since query parameter. This param can be used to either return tasks that are incomplete (e.g. completed_since=now) or tasks that have been completed since a specified time (e.g. completed_since=2012-02-22T02:06:58.158Z).

Good luck and happy coding!


#3

Hey @Jeff_Schneider,

Thank you for your answer…I do have a paid accound…I’m wondering how this would look in python ? And why there’s so less info regarding python ?

Thanks

Thanks


#4

Hey @adrian_blanaru, we have client libraries in a variety of languages including in python.


#5

Hi @adrian_blanaru, I don’t think it’s asasa’s job to document how to call their api in python, or in any language… it’s the job of the developer to know how to call any api, like I did by following these samples:

https://docs.python.org/2/library/httplib.html#examples


#6

@Jeff_Schneider & @Frederic_Malenfant thank you guys… I’m not saying it’s asana’s job to document how u call your api in python or ruby or any other language…I was just wondering why there’s only 55 threads on https://stackoverflow.com/search?q=asana+python … some of the https://github.com/Asana/python-asana are so old and useless… maybe few separated topics on the forum like python regarding questions…ruby…and so on… Thanks and greetings from Germany