0

我有以下任务:

$ curl "https://app.asana.com/api/1.0/tasks/259676837324664" | jq
{
  "data": {
    "id": 259676837324664,
    "assignee": {
      "id": 202581546604537,
      "name": "Leonid"
    },
    "assignee_status": "inbox",
    "completed": false,
    "completed_at": null,
    "created_at": "2017-02-01T13:53:31.556Z",
    "custom_fields": [],
    "due_at": null,
    "due_on": "2017-02-02",
    "followers": [
      {
        "id": 190628515114637,
        "name": "Remco"
      },
      {
        "id": 202581546604537,
        "name": "Leonid"
      }
    ],
    "hearted": false,
    "hearts": [],
    "memberships": [
      {
        "project": {
          "id": 256988229703133,
          "name": "MS2: Private ICO"
        },
        "section": {
          "id": 256988229703195,
          "name": "Week 04"
        }
      }
    ],
    "modified_at": "2017-02-02T09:05:16.906Z",
    "name": "Test Web3 detection/operation in Parity/Metamask/Mist",
    "notes": "",
    "num_hearts": 0,
    "parent": null,
    "projects": [
      {
        "id": 256988229703133,
        "name": "MS2: Private ICO"
      }
    ],
    "tags": [],
    "workspace": {
      "id": 163713730991759,
      "name": "Neufund"
    }
  }
}

我想将其移至“第 04 周”部分的底部:

$ curl -X POST "https://app.asana.com/api/1.0/tasks/259676837324664/addProject"\
    -d "section=256988229703195&insertBefore=null&project=256988229703133" | jq
{
  "errors": [
    {
      "message": "section: Not the correct type",
      "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"
    }
  ]
}

我把section.id它用作section参数。这就是我理解 API 文档的方式。该错误表明这是不正确的。

我做错了什么?

(由于明显的原因,身份验证令牌标头被遗漏了。我可以使用相同的帐户将任务移至 Web 界面的底部,因此授权不是问题)

4

1 回答 1

2

处理板项目的功能目前落后于标志。我已为您的组织启用了该标志,因此如果您仍然遇到问题,请告诉我们。

请注意,您不能在端点上同时指定sectioninsert_before参数。POST /tasks/:task/addProject

于 2017-02-02T18:19:55.867 回答