2017-04-11 36 views
0

我正在嘗試:不能在Microsoft圖表Explorer更新taskDetails

繼上Microsoft Graph Explorer的文檔Update taskDetails,我試圖在PATCH請求:

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}" 
     } 
    } 
} 

使用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} 

了一份關於計劃

奇怪的是,Planner使用完全不同的API來更新taskDetails,並且沒有關於該API的文檔。

任何幫助,將不勝感激;這是我們工作流程中的程序化Planner訪問的企業部署。

回答

1

我發佈這個問題12個小時後,微軟推出了Graph Planner API的重大更新。該問題現已解決。

的處理以更新任務描述是:

If-Match: {etag} 

有效載荷

{ 
    "description": "Your new description" 
} 

的關鍵是使用的eTag從taskDetails對象,任務目標。