如何修复 - 更新 plannertaskdetails - If-Match header 包含无效值
How to fix - Update plannertaskdetails - If-Match header contains an invalid value
我正在尝试更新 (PATCH) 现有的 Microsoft Planner 任务,以向其中添加一 (1) 个清单项目。我正在使用 Microsoft doc https://docs.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"
}
}
}
据我所知,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
这些是我的 headers:
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJub..........
If-Match: W/"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBARCc="
这是我的 body:
{
"previewType": "checklist",
"checklist": {
"{{$guid}}":{
"@odata.type": "microsoft.graph.plannerChecklistItem",
"title": "Update task details",
"isChecked": false
}
}
}
我原以为 If-Match 键是正确的,因为我使用了 Microsoft 文章,但不知何故导致了错误消息:
"The If-Match header contains an invalid value."
我遇到了类似的问题。更新任务详细信息时,我使用了任务中的 etag。
任务和任务详细信息是不同的对象。
检查 - MS Graph doc
使用以下方法从创建任务的任务详细信息中获取 etag 值:
GET https://graph.microsoft.com/v1.0/planner/tasks/{task-id}/details
我正在尝试更新 (PATCH) 现有的 Microsoft Planner 任务,以向其中添加一 (1) 个清单项目。我正在使用 Microsoft doc https://docs.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"
}
}
}
据我所知,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
这些是我的 headers:
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJub..........
If-Match: W/"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBARCc="
这是我的 body:
{
"previewType": "checklist",
"checklist": {
"{{$guid}}":{
"@odata.type": "microsoft.graph.plannerChecklistItem",
"title": "Update task details",
"isChecked": false
}
}
}
我原以为 If-Match 键是正确的,因为我使用了 Microsoft 文章,但不知何故导致了错误消息:
"The If-Match header contains an invalid value."
我遇到了类似的问题。更新任务详细信息时,我使用了任务中的 etag。 任务和任务详细信息是不同的对象。 检查 - MS Graph doc
使用以下方法从创建任务的任务详细信息中获取 etag 值:
GET https://graph.microsoft.com/v1.0/planner/tasks/{task-id}/details