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§ion-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"
}
}
}
