gpt4 book ai didi

azure - 微软图形API : assignments(plannerAssignment) property of Task Resource(plannerTask ) is not working

转载 作者:行者123 更新时间:2023-12-02 06:11:47 24 4
gpt4 key购买 nike

您好,我正在向 graph api(Beta)发出发布请求,以与受让人一起创建任务,如下所示。

var settings = {
"async": true,
"crossDomain": true,
"url": "https://graph.microsoft.com/beta/planner/tasks",
"method": "POST",
"headers": {
"content-type": "application/json",
"authorization": "Bearer token",
"cache-control": "no-cache",
"postman-token": "f6dd56ab-6fb4-f553-74aa-792945ba98b6"
},
"data": {"title": "testTask","planId": "rPWMLzwXlUOA33dPNU9-dWUAAoRf, "assignments": {"7d0544e0-2ed9-4aab-92a0-38efcaa292cd": {"orderHint": '5637' } } }
}

$.ajax(settings).done(function (response) {
console.log(response);
});

但它给出错误如下,

{
"error": {
"code": "",
"message": "The request is invalid.",
"innerError": {
"request-id": "14a2ef00-a271-4be8-8197-71aa46379017",
"date": "2017-04-18T11:29:42"
},
"innererror": {
"message": "task : An error has occurred.\r\n"
}
}
}

任务资源链接:https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/resources/plannertask

最佳答案

我发现该请求有两个问题。

  • 对于开放类型属性,您需要包含属性的复杂类型值的类型,在本例中为“microsoft.graph.plannerAssignment”。
  • 请求中发送的订单提示遵循描述的格式 here ,根据该格式,您的输入无效。在本例中,由于这是第一项,因此顺序提示应为“!”。您可以使用 ” !”如果您不关心商品的顺序,则可以为您生成所有订单提示。

进行必要的更改后,您的请求应如下所示:

{"title": "testTask","planId": "rPWMLzwXlUOA33dPNU9-dWUAAoRf, "assignments": {"7d0544e0-2ed9-4aab-92a0-38efcaa292cd": { "@odata.type": "microsoft.graph.plannerAssignment", "orderHint": " !"} } }

关于azure - 微软图形API : assignments(plannerAssignment) property of Task Resource(plannerTask ) is not working,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43471425/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com