question

PaulMc-4102 avatar image
0 Votes"
PaulMc-4102 asked VickyKumarMindtreeConsultingPVTLTD-5545 commented

Request to get OneNote page content returns 404

We are having an issue with the OneNote api where when we try and access the content for some pages we get a 404 error response.

I can confirm we can reproduce the error in the graph explorer. While the page loads successfully in the onenote client and web.

 https://graph.microsoft.com/v1.0/users/user@test.com/onenote/pages/0-22e6d1d60c0807e31875c40f4d3efc68!1-587D2B9129361EF3!755736

The request above returns a 200 and essentially the following response (PII cleaned out)

 {
     "@odata.context": https://graph.microsoft.com/v1.0/$metadata#users('user@test.com')/onenote/pages/$entity,
     "id": "0-22e6d1d60c0807e31875c40f4d3efc68!1-587D2B9129361EF3!755736",
     "self": https://graph.microsoft.com/v1.0/users/user@test.com/onenote/pages/0-22e6d1d60c0807e31875c40f4d3efc68!1-587D2B9129361EF3!755736,
     "createdDateTime": "2021-10-24T22:08:28.947Z",
     "title": "Test - 26/10/2021",
     "createdByAppId": "",
     "contentUrl": https://graph.microsoft.com/v1.0/users/user@test.com/onenote/pages/0-22e6d1d60c0807e31875c40f4d3efc68!1-587D2B9129361EF3!755736/content,
     "lastModifiedDateTime": "2021-11-04T09:57:57Z",
     "links": {
         "oneNoteClientUrl": {
             "href": onenote:https://d.docs.live.net/587d2b9129361ef3/Documents/SomeNotebook/Test.one#Test%20-%2026%2F10%2F&section-id=19268cf1-a68a-4e6a-80d5-b3aba21a9b26&page-id=5926d327-a56b-43a0-a60e-ff4c453bd18c&end
         },
         "oneNoteWebUrl": {
             "href": https://onedrive.live.com/redir.aspx?cid=587d2b9129361ef3&page=edit&resid=587D2B9129361EF3!755716&parId=587D2B9129361EF3!132&wd=target%28Test.one%7C19268cf1-a68a-4e6a-80d5-b3aba21a9b26%2FTest%20-%2026%5C%2F10%5C%2F%7C5926d327-a56b-43a0-a60e-ff4c453bd18c%2F%29
         }
     },
     parentSection@odata.context: https://graph.microsoft.com/v1.0/$metadata#users('user@test.com')/onenote/pages('0-22e6d1d60c0807e31875c40f4d3efc68%211-587D2B9129361EF3%21755736')/parentSection/$entity,
     "parentSection": {
         "id": "0-587D2B9129361EF3!755736",
         "displayName": "Test",
         "self": https://graph.microsoft.com/v1.0/users/user@test.com/onenote/sections/0-587D2B9129361EF3!755736
     }
 }

However when we call the content url contained in the response we get a 404 error and the following body.

 {
     "error": {
         "code": "20102",
         "message": "The specified resource ID does not exist.",
         "innerError": {
             "date": "2022-02-22T06:48:36",
             "request-id": "979b6af4-6d36-45f3-8f19-576640e9ca4f",
             "client-request-id": "6422879d-6368-877f-2f94-08f47fcc44f4"
         }
     }
 }
microsoft-graph-notes
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

One other part of the repro step is that it is for a personal account.

I have noticed that some things are different for personal accounts.

  • new pages dont always show up consistently

  • the last modified date does not update


0 Votes 0 ·

Hi @PaulMc-4102, Excuse me, do you want to get content like this?
177028-image.png


0 Votes 0 ·
image.png (166.2 KiB)

Yes. Essentially it works fine most of the time. However we have a number of pages which error in some notebooks (for personal accounts as far as I can see).

Our application gets the recently modified pages via the sections endpoint, then queries the content as you have and looks for tags in each page.

0 Votes 0 ·

Hello @PaulMc-4102, does the below answer help you? please reply to me if you have any other questions?

0 Votes 0 ·

1 Answer

VickyKumarMindtreeConsultingPVTLTD-5545 avatar image
0 Votes"
VickyKumarMindtreeConsultingPVTLTD-5545 answered VickyKumarMindtreeConsultingPVTLTD-5545 commented

Hi @PaulMc-4102
you want to see the written content on OneNote, Could you please try with the URL - https://graph.microsoft.com/v1.0/me/onenote/pages/{page_id}/preview , let me know if that worked?

Thanks

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Sorry for the delayed response. It was my managers account which had this repro.

Something has changed, when we try the urls (page, content, preview) they all returned the error... even the base page endpoint which worked previously. Could not confirm if he had moved that page now.

I will need to do more investigation and check the logs. I can confirm that the page was for a meeting note... and the meeting was from a different account. Not sure if this is maintained as a resource link.

The personal account notebooks in the graph feel very inconsistent. I did a call with my manager and got him to use the graph explorer and we both saw together pages missing in the graph and last modified dates not being updated.

0 Votes 0 ·

Hi @PaulMc-4102, sorry for inconvenience ,this looks weird . Could you please try to check in other Notepad pages , try to make some changes and check are you able to see the last modified date changes?

0 Votes 0 ·