我正在尝试更新 (PATCH) 现有的 Microsoft Planner 任务,以向其中添加一 (1) 个清单项目。我使用 Microsoft doc https://learn.microsoft.com/en-us/graph/api/plannertaskdetails-update?view=graph-rest-1.0&tabs=javascript作为参考,并且我使用 Postman 发送请求。
{
"error": {
"code": "",
"message": "The If-Match header contains an invalid value.",
"innerError": {
"request-id": "7b50a25b-7c5a-443b-9a41-1b6314be4014",
"date": "2019-05-16T23:59:03"
}
}
}
Run Code Online (Sandbox Code Playgroud)
据我所知,If-Match 键的构建方式与 Microsoft 的文章使用它的方式完全相同。我发现了一篇有点类似的文章(https://powerusers.microsoft.com/t5/Connecting-To-Data/Custom-Connector-Graph-The-If-Match-header-must-be-specified-for/td- p/144092),但是这个人以不同的方式填写 If-Match 值,这对我来说根本不起作用......
我首先重用了创建任务后收到的响应中的 eTAG 值:
"@odata.etag": "W/\"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBARCc=\""
有人知道我在这里做错了什么吗?
这是我的补丁:
https://graph.microsoft.com/v1.0/planner/tasks/n...................pYAM-DX/details
Run Code Online (Sandbox Code Playgroud)
这些是我的标题:
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJub..........
If-Match: W/"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBARCc="
Run Code Online (Sandbox Code Playgroud)
这是我的身体:
{
"previewType": "checklist",
"checklist": {
"{{$guid}}":{
"@odata.type": "microsoft.graph.plannerChecklistItem",
"title": "Update task details",
"isChecked": false
}
}
}
Run Code Online (Sandbox Code Playgroud)
我原以为 …