我正在尝试在 Debian 命令行上使用 curl 创建一个 Asana 任务。我将任务分配给特定项目和该项目中的特定部分。我的 curl 命令会创建一个任务,直到我添加了“memberships”参数。这是该参数的外观。
-d "memberships=[{project:{id:96927952190628},section:{id:96927952190688}}]"
这是完整的命令(出于隐私考虑,删除了一些信息):
curl -H 'Authorization: Bearer <id>' https://app.asana.com/api/1.0/tasks -d "assignee=me" -d "name=New Task" -d "completed=false" -d "workspace=923066726484" -d "memberships=[{project:{id:96927952190628},section:{id:96927952190688}}]"
这似乎与基于此处描述的 Asana API 的要求相匹配:https ://asana.com/developers/api-reference/tasks#create (请参阅“会员资格”字段定义中的示例)。
当我执行此命令时,Asana 返回以下 json。
{"errors":[{"message":"memberships: [0]: project: Missing required field","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"}]}
那么,我做错了什么?
谢谢!