0

When I am creating a tag using API - Getting a - 201 Create - as expected

Create Request:

curl -X POST -H "Authorization: Bearer <my-token>" -d 'name=tag1&workspace=42783899288073' "https://app.asana.com/api/1.0/tags"

Response:

{ "data": { "id": 156692684103314, "created_at": "2016-07-18T19:39:38.131Z", "name": "tag1", "notes": "", "workspace": { "id": 42783899288073, "name": "Personel" }, "color": null, "followers": [] } }

When getting list of tags in a workspace - above created tag does not appear in it

Request:

curl -X GET -H "Authorization: Bearer <my-token>" https://app.asana.com/api/1.0/workspaces/42783899288073/tags

Response:

{ "data": [ { "id": 42788763054709, "name": "Urgent" }, { "id": 155447666873671, "name": "P1" }, { "id": 154977993344918, "name": "Continuous" }, { "id": 155447666873680, "name": "brush" }, { "id": 155447666873678, "name": "study" }, { "id": 155616413301854, "name": "start" } ] }

What am I missing in Create tag API?

EDIT - As @agnoster pointed out - unless there is task for that tag - it does not appear in tag list api. Create a task with this tag-id. (this task can be deleted sub-sequently). After this tag will start appearing in tag list.

Amit G
  • 2,293
  • 3
  • 24
  • 44

1 Answers1

1

I work at Asana. It looks like I am experiencing the same issue when I try something similar. We'll take a look at this.

For now, if you add the tag you created to a task it should show up in the list. Also you can query for your tag directly using the id you get back. I think the current behavior is a bit wonky so it definitely warrants some investigation. Sorry for the inconvenience!

Mark
  • 176
  • 4