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.