2016-06-28 66 views
0

我想知道如何使用Microsoft Graph API在Planner計劃中創建任務。 現在我試圖在使用「Create task」API的計劃器計劃中完成任務,但是我得到了UnknownError。如何通過Microsoft Graph API在計劃中添加任務

{ 
    "error": { 
     "code": "UnknownError", 
     "message": "", 
     "innerError": { 
      "request-id": "2303b87d-fb0c-431c-9336-c93908758d25", 
      "date": "2016-06-28T10:16:56" 
     } 
    } 
} 

正如文檔中所描述的那樣,我發佈到api這樣。

POST https://graph.microsoft.com/beta/tasks 
Content-type: application/json 
Content-length: 192 
{ 
    "assignedTo": "<I set my uuid>", 
    "planId": "<I set planId which I created>", 
    "bucketId": "<I set bucketId which is included the plan>", 
    "title": "test4", 
    "orderHint": "A" 
} 

任何想法,我哪裏會出錯?如果您知道如何在Planner計劃中添加任務,請分享這個想法?

回答

1

這個API最近更新了Masayuki - 帶有新的端點。我認爲你的代碼的主要問題是orderHint應該是「!」這在一開始就增加了。你實際上並沒有設置訂單提示,而是設定你的新任務與現有的任務相關。微軟Graph網站上新的文檔,並從我的博客文章鏈接下面。

目前的測試版的端點也應該會https://graph.microsoft.com/beta/planner/tasks

看看其中有一個附加腳本,通過這樣的步驟走我的最新博客文章。 https://blogs.msdn.microsoft.com/brismith/2017/04/17/planner-cloning-a-plan-with-multiple-assignments/

最好的問候, 布賴恩

+0

非常感謝你布賴恩。我會檢查更新的API並再次打電話。 – Masayuki

0

我試着在Fiddler中重現這個(用我自己的planId,bucketId和assignedTo值),但是當你在這裏構造它時,調用對我有用。你還有這個問題嗎?

你能傳遞一個不起作用的呼叫的提琴手蹤跡嗎?