更新任务 - 更改标签

时间:2017-03-05 05:46:55

标签: asana asana-api

尝试更新与任务相关联的标签:

请求:

PUT https://app.asana.com/api/1.0/tasks/286045228787956

请求有效负载:

{"data":{"tags":[157484377992312,157484408318898,285998759647376]}}

回复:400 身体:

{"errors":[{"message":"tags: Cannot write this property","help":"For more information on API status codes and how to handle them, read the docs on errors: https://asana.com/developers/documentation/getting-started/errors"}]}

我们不能编辑任务标签吗?或者我传递了错误的参数?

文档无效:https://asana.com/developers/api-reference/tasks#update

1 个答案:

答案 0 :(得分:1)

要编辑任务上的标记,您需要使用端点

POST /tasks/<id>/addTag
POST /tasks/<id>/removeTag

in a different section of the documentation you referenced所述。

有效负载需要

{"data":{"tag":<your_tag_id>}}