Ell*_*Fie 2 rest web-applications microsoft-graph-api
我正在尝试:
按照Microsoft Graph Explorer上的Update taskDetails文档,我正在尝试对以下内容发出 PATCH 请求:
https://graph.microsoft.com/beta/tasks/{Id}/details
Run Code Online (Sandbox Code Playgroud)
请求头:
Content-type: application/json
Prefer: "return=represent"
If-Match: {@odata.etag from a successful prior GET on taskDetails}
Run Code Online (Sandbox Code Playgroud)
请求正文:
{
"description": "My new description",
"previewType": "description",
"references": {},
"checklist": {}
}
Run Code Online (Sandbox Code Playgroud)
回复:
client-request-id: {some Id}
content-type: application/json
cache-control: private
request-id: {some Id}
Status Code: 412 <--- Pre-condition not met!
{
"error": {
"code": "UnknownError",
"message": "",
"innerError": {
"request-id": "{some Id}",
"date": "{date}"
}
}
}
Run Code Online (Sandbox Code Playgroud)
使用 Chrome 开发者工具解析响应头:
HTTP/1.1 412 Precondition Failed
Cache-Control: private
Transfer-Encoding: chunked
Content-Type: application/json
request-id: {some Id}
client-request-id: {some Id}
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"West US","Slice":"SliceB","ScaleUnit":"002","Host":"AGSFE_IN_1","ADSiteName":"WST"}}
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: ETag, Location, Preference-Applied, Content-Range, request-id, client-request-id
Duration: 68.3028
Date: {date}
Run Code Online (Sandbox Code Playgroud)
关于 Planner 的注释
奇怪的是,Planner 似乎使用了完全不同的 API 来更新 taskDetails,并且没有该 API 的文档。
任何帮助,将不胜感激; 这是我们工作流程中程序化 Planner 访问的企业部署。
在我发布问题 12 小时后,微软推送了 Graph Planner API 的重大更新。该问题现已解决。
更新任务描述的过程是:
标题:
If-Match: {etag}
Run Code Online (Sandbox Code Playgroud)
有效负载:
{
"description": "Your new description"
}
Run Code Online (Sandbox Code Playgroud)
关键是使用 taskDetails 对象中的 etag,而不是任务对象。
| 归档时间: |
|
| 查看次数: |
1299 次 |
| 最近记录: |