OneNote API - no HTTP Resource found?

落花浮王杯 提交于 2019-12-12 01:21:56

问题


I'm calling this endpoint https://graph.microsoft.com/beta/me/notes/, and while the right user id was fetched, the below error occurs... Not sure what's going on at all, as this error is not documented:

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

--

When trying notebooks/ apparently my OAuth token doesn't have the scope - however it seems that the oauth token registration does not include notes?

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


回答1:


This 404-NotFound status code is expected since https://graph.microsoft.com/beta/me/notes is an incomplete uri. It is the entry point for accessing all OneNote resources but the uri is missing the rest of the path (to specify which resource to get).

for e.g. call https://graph.microsoft.com/beta/me/notes/notebooks to get the list of notebooks. Or https://graph.microsoft.com/beta/me/notes/pages to get a list of pages etc.




回答2:


you need more than just "/notes" - try "/notes/notebooks" for example.




回答3:


I was having the same problem before. I was querying my personal hotmail account for onenote notebooks https://graph.microsoft.com/beta/me/notes/notebooks and was getting no resource found. Then I used my work account to login and found that it worked. For some reason the graph api queries everything except OneNote when the personal account is used. No problems will come up with the work or organisation account.



来源:https://stackoverflow.com/questions/35666882/onenote-api-no-http-resource-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!