Rest 无法在Microsoft图形资源管理器中更新任务详细信息

Rest 无法在Microsoft图形资源管理器中更新任务详细信息,rest,web-applications,microsoft-graph-api,Rest,Web Applications,Microsoft Graph Api,我正在尝试的内容: Content-type: application/json Prefer: "return=represent" If-Match: {@odata.etag from a successful prior GET on taskDetails} { "description": "My new description", "previewType": "description", "references": {}, "checklist": {} }

我正在尝试的内容:

Content-type: application/json
Prefer: "return=represent"
If-Match: {@odata.etag from a successful prior GET on taskDetails}
{
  "description": "My new description",
  "previewType": "description",
  "references": {},
  "checklist": {}
}
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}"
        }
    }
}
根据上的文档,我正在尝试对以下内容进行修补请求:

https://graph.microsoft.com/beta/tasks/{Id}/details
请求头:

Content-type: application/json
Prefer: "return=represent"
If-Match: {@odata.etag from a successful prior GET on taskDetails}
{
  "description": "My new description",
  "previewType": "description",
  "references": {},
  "checklist": {}
}
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}"
        }
    }
}
请求正文:

Content-type: application/json
Prefer: "return=represent"
If-Match: {@odata.etag from a successful prior GET on taskDetails}
{
  "description": "My new description",
  "previewType": "description",
  "references": {},
  "checklist": {}
}
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}"
        }
    }
}
响应:

Content-type: application/json
Prefer: "return=represent"
If-Match: {@odata.etag from a successful prior GET on taskDetails}
{
  "description": "My new description",
  "previewType": "description",
  "references": {},
  "checklist": {}
}
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}"
        }
    }
}
关于计划者的说明

奇怪的是,Planner似乎使用了一个完全不同的API来更新taskDetails,并且没有关于该API的文档


任何帮助都将不胜感激;这是在我们的工作流程中对Programming Planner access的企业部署。

12小时后,我发布了这个问题,Microsoft对Graph Planner API进行了重大更新。这个问题现在已经解决了

更新任务描述的过程是:

  • 获取{taskId}/details
  • 从响应中获取@odata.etag
  • 修补程序{taskId}/详细信息,包括:
标题

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}
If-Match: {etag}
{
  "description": "Your new description"
}
有效载荷

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}
If-Match: {etag}
{
  "description": "Your new description"
}

关键是使用taskDetails对象中的etag,而不是任务对象。

在我发布问题12小时后,微软对Graph Planner API进行了重大更新。这个问题现在已经解决了

更新任务描述的过程是:

  • 获取{taskId}/details
  • 从响应中获取@odata.etag
  • 修补程序{taskId}/详细信息,包括:
标题

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}
If-Match: {etag}
{
  "description": "Your new description"
}
有效载荷

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}
If-Match: {etag}
{
  "description": "Your new description"
}
关键是使用taskDetails对象中的etag,而不是任务对象