2016-02-27 30 views
0

我打電話這個端點https://graph.microsoft.com/beta/me/notes/,並且在正確的用戶ID是牽強,會出現下面的錯誤...不知道發生了什麼事情所有的,因爲這個錯誤未記錄:OneNote API - 找不到HTTP資源?

 
{ 
error: { 
code: "UnknownError", 
message: "{ "Message": "No HTTP resource was found that matches the request URI 'https://www.onenote.com/api/beta/users('b2909c67-ab0e-45cf-a823-b0f945c22c00')/notes'." }", 
innerError: { 
request-id: "01b7d80f-aa04-463a-be58-c5a12414e243", 
date: "2016-02-27T07:07:06" 
} 
} 
} 

-

當試圖筆記本電腦/顯然我的OAuth令牌沒有範圍 - 但似乎oauth令牌註冊不包括註釋?

 
{ 
error: { 
code: "40004", 
message: "The OAuth token provided does not have the necessary scopes to complete the request. Please make sure you are including one of the following scopes: Notes.ReadWrite.All,Notes.Read.All", 
innerError: { 
request-id: "73202234-970e-42c8-a569-eca4266ae75a", 
date: "2016-03-01T01:49:32" 
} 
} 
} 

enter image description here

回答

1

這404-NOTFOUND狀態碼預計由於https://graph.microsoft.com/beta/me/notes是一個不完整的URI。它是訪問所有OneNote資源的入口點,但是uri缺少路徑的其餘部分(以指定要獲取的資源)。

例如,請致電https://graph.microsoft.com/beta/me/notes/notebooks以獲取筆記本電腦列表。 或https://graph.microsoft.com/beta/me/notes/pages獲取頁面列表等。

+0

你知道如何將註釋添加到oauth標記範圍嗎? – ina

+0

如何將註釋添加爲oauth標記中的可用範圍? (請參閱更新後的問題) – ina

+0

不幸的是,圖形門戶網站尚未包含OneNote範圍,因爲OneNote API與Graph的集成僅在測試版中可用。 嘗試通過http://blogs.msdn.com/b/onenotedev/archive/2015/04/30/register-your-application-in-azure-ad.aspx – DipakBoyed

0

您不僅需要「/ notes」 - 例如嘗試「/ notes/notebooks」。

+0

中提到的步驟註冊示波器。將備註添加爲oauth標記中的可用範圍? (請參閱更新的問題) – ina

+0

不幸的是,圖形門戶網站尚未包含OneNote範圍,因爲OneNote API與Graph的集成僅在測試版中可用。嘗試通過http://blogs.msdn.com/b/onenotedev/archive/2015/04/30/register-your-application-in-azure-ad.aspx中提到的步驟註冊範圍 – DipakBoyed

0

我以前有同樣的問題。我在查詢我的個人hotmail帳戶的onenote筆記本電腦https://graph.microsoft.com/beta/me/notes/notebooks,並沒有找到資源。然後我用我的工作帳戶登錄並發現它工作。出於某種原因,當使用個人帳戶時,圖形API會查詢除OneNote之外的所有內容。工作或組織賬戶不會出現任何問題。 enter image description here