Onenote - same api call returns different data

Vignesh 1 Reputation point
2021-11-19T06:28:37.887+00:00

i am trying to fetch all the pages in a particular section of a note. so i made the appropriate api call. from my local setup (an indian IP). and got the actual set of responses, which are correct. but when i run the exact same api call from my setup in amazon aws us-east-1 region, i am getting empty response from the api (not any server error codes). why am i getting different responses from onenote for the same api call? i have been experiencing this behaviour for some time now. where am i getting it wrong?

actual response from api, when run on local setup (from an indian IP):

response from api: {'@odata.context': "https://graph.microsoft.com/v1.0/$metadata#users('needlnewqa%40gmail.com')/onenote/sections('0-28623E3D62E45D77%21159')/pages", 'value': [{'id': '0-a89cad7c13c8436d979a15e01981b5d8!122-28623E3D62E45D77!159', 'self': 'https://graph.microsoft.com/v1.0/users/needlnewqa@gmail.com/onenote/pages/0-a89cad7c13c8436d979a15e01981b5d8!122-28623E3D62E45D77!159', 'createdDateTime': '2021-09-24T18:15:02Z', 'title': 'Test\xa0', 'createdByAppId': 'ONDC Notebooks', 'contentUrl': 'https://graph.microsoft.com/v1.0/users/needlnewqa@gmail.com/onenote/pages/0-a89cad7c13c8436d979a15e01981b5d8!122-28623E3D62E45D77!159/content', 'lastModifiedDateTime': '2021-10-21T13:20:26Z', 'links': {'oneNoteClientUrl': {'href': 'onenote:https://d.docs.live.net/28623e3d62e45d77/Documents/Test-%20select%20all/Quick%20Notes.one#Test%C2%A0&section-id=fccf810f-9e1f-4a5b-815f-dad72ee66f90&page-id=cfb35706-c5e3-4ebc-943a-c3670005050f&end'}, 'oneNoteWebUrl': {'href': 'https://onedrive.live.com/redir.aspx?cid=28623e3d62e45d77&page=edit&resid=28623E3D62E45D77!157&parId=28623E3D62E45D77!103&wd=target%28Quick%20Notes.one%7Cfccf810f-9e1f-4a5b-815f-dad72ee66f90%2FTest%C2%A0%7Ccfb35706-c5e3-4ebc-943a-c3670005050f%2F%29'}}, 'parentSection@odata.context': "https://graph.microsoft.com/v1.0/$metadata#users('needlnewqa%40gmail.com')/onenote/sections('0-28623E3D62E45D77%21159')/pages('0-a89cad7c13c8436d979a15e01981b5d8%21122-28623E3D62E45D77%21159')/parentSection/$entity", 'parentSection': {'id': '0-28623E3D62E45D77!159', 'displayName': 'Quick Notes', 'self': 'https://graph.microsoft.com/v1.0/users/needlnewqa@gmail.com/onenote/sections/0-28623E3D62E45D77!159'}}]}

actual response from api, when run on aws setup located in us-east-1:

response from api: {'@odata.context': "https://graph.microsoft.com/v1.0/$metadata#users('needlnewqa%40gmail.com')/onenote/sections('0-28623E3D62E45D77%21159')/pages", 'value': []}

i feel, ip address is definitely part of something that causes the difference in responses from api.

Check the actual curl requests i made here. just removed the auth token from the request made.

$ curl 'https://api.ipify.org?format=json'

{"ip":"74.208.157.142"} # US ip address
$
$ curl -X GET -H 'Accept: */*' -H 'Authorization: Bearer SomeAuthBearer' -H 'Connection: keep-alive' -H 'Content-Type: application/x-www-url-form-urlencoded' -H 'Host: graph.microsoft.com' -H 'User-Agent: python-requests/2.26.0' 'https://graph.microsoft.com/v1.0/users/needlnewqa@gmail.com/onenote/sections/0-28623E3D62E45D77!159/pages?$orderby=lastModifiedDateTime%20asc'    

{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users('needlnewqa%40gmail.com')/onenote/sections('0-28623E3D62E45D77%21159')/pages","value":[]}
$
$ curl 'https://api.ipify.org?format=json'

{"ip":"122.164.205.110"} #Indian ip address
$
$  curl -X GET -H 'Accept: */*' -H 'Authorization: Bearer SomeAuthBearer' -H 'Connection: keep-alive' -H 'Content-Type: application/x-www-url-form-urlencoded' -H 'Host: graph.microsoft.com' -H 'User-Agent: python-requests/2.26.0' 'https://graph.microsoft.com/v1.0/users/needlnewqa@gmail.com/onenote/sections/0-28623E3D62E45D77!159/pages?$orderby=lastModifiedDateTime%20asc'

{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users('needlnewqa%40gmail.com')/onenote/sections('0-28623E3D62E45D77%21159')/pages","value":[{"id":"0-a89cad7c13c8436d979a15e01981b5d8!122-28623E3D62E45D77!159","self":"https://graph.microsoft.com/v1.0/users/needlnewqa@gmail.com/onenote/pages/0-a89cad7c13c8436d979a15e01981b5d8!122-28623E3D62E45D77!159","createdDateTime":"2021-09-24T18:15:02Z","title":"Test\u00a0","createdByAppId":"ONDC Notebooks","contentUrl":"https://graph.microsoft.com/v1.0/users/needlnewqa@gmail.com/onenote/pages/0-a89cad7c13c8436d979a15e01981b5d8!122-28623E3D62E45D77!159/content","lastModifiedDateTime":"2021-10-21T13:20:26Z","links":{"oneNoteClientUrl":{"href":"onenote:https://d.docs.live.net/28623e3d62e45d77/Documents/Test-%20select%20all/Quick%20Notes.one#Test%C2%A0&section-id=fccf810f-9e1f-4a5b-815f-dad72ee66f90&page-id=cfb35706-c5e3-4ebc-943a-c3670005050f&end"},"oneNoteWebUrl":{"href":"https://onedrive.live.com/redir.aspx?cid=28623e3d62e45d77&page=edit&resid=28623E3D62E45D77!157&parId=28623E3D62E45D77!103&wd=target%28Quick%20Notes.one%7Cfccf810f-9e1f-4a5b-815f-dad72ee66f90%2FTest%C2%A0%7Ccfb35706-c5e3-4ebc-943a-c3670005050f%2F%29"}},"parentSection@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users('needlnewqa%40gmail.com')/onenote/sections('0-28623E3D62E45D77%21159')/pages('0-a89cad7c13c8436d979a15e01981b5d8%21122-28623E3D62E45D77%21159')/parentSection/$entity","parentSection":{"id":"0-28623E3D62E45D77!159","displayName":"Quick Notes","self":"https://graph.microsoft.com/v1.0/users/needlnewqa@gmail.com/onenote/sections/0-28623E3D62E45D77!159"}}]}
$
Microsoft Graph Notes API
Microsoft Graph Notes API
A Microsoft API that lets your app get authorized access to a user's OneNote notebooks, sections, and pages in a personal or organization account.
41 questions
{count} votes