0
votes

I am trying to access graph api to read notes pages, I am getting this error.

{
  "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": "d333a0ee-fe7c-4743-8498-350dc340dd8e",
      "date": "2016-04-27T16:52:22"
    }
  }
}

I have added new app to work account and added required delegated permissions to my app. Permission details are as follows.

Resource: Microsoft Graph permission Scopes: Read User notebooks

Resource: OneNote permission Scopes: View one note notebooks, View one note notebooks in your organization.

the endpoint I am using: https://graph.microsoft.com/beta/me/notes/pages

I did not find answer in the same question which is asked previously OneNote API - no HTTP Resource found?

2

2 Answers

1
votes

You could give the "Read all notebooks that the user can access (preview)" or " Read and write notebooks that the user can access (preview)" permission to Microsoft Graph: enter image description here

In my test , without these permissions , i will get the same error as yours , with any of these permissions ,"https://graph.microsoft.com/beta/me/notes/pages" endpoint works fine, this endpoint needs Notes.ReadWrite.All or Notes.Read.All scope.

0
votes

this request of your was found to be targeting GET https://graph.microsoft.com/beta/me/notes/notebooks

We found the following scopes in the token- Notes.Create,Notes.Read,Notes.ReadWrite,Notes.ReadWrite.CreatedByApp

but none of the Notes.ReadWrite.All,Notes.Read.All scopes were there.

can you double check on the scopes you assigned?