更新任务 - 更改标签

Update task - change tags

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

要求:

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

为了编辑任务上的标签,您需要使用端点

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

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

负载需要

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