API - Get all tasks with a particular tag

I am trying to retrieve all tasks that have a particular tag associated with them. Current URL call I’m using is:

https://app.asana.com/api/1.0/workspaces/xxxxxxxxxxxxx/tags/1201440540948308/tasks)

Is there something wrong in my syntax? I’m getting an Error 404:

{“errors”:[{“message”:“No matching route for request”,“help”:“For more information on API status codes and how to handle them, read the docs on errors: Asana”}]}

@Jordan_Ashley_Cryder,

According to the API docs, that route as you specified doesn’t exist. One does exist as you have it except without the “/tasks” at the end but that doesn’t help you find tasks, it only finds tags.

You can use this, however, to find tasks with a tag:

https://developers.asana.com/docs/search-tasks-in-a-workspace

Larry

2 Likes

If you don’t want to use the “search” endpoint provided by @lpb, the classic method is to use that endpoint, more easy to use if you need paging results (for more than 100 results).
https://app.asana.com/api/1.0/tags/xxxxx/tasks
You don’t need to enter the workspace id, your query was OK except for the /workspaces/xxxx/

3 Likes

Whoops, @Frederic_Malenfant’s solution is best; I had missed it only looking in the docs under Tags not under Tasks.

2 Likes

This topic was automatically closed after 3 days. New replies are no longer allowed.