OneNote API intermittently returns HTTP 400 when querying O365 SharePoint SiteId -
my code calls onenote api resolve sharepoint online site url sitecollectionid , siteid. bearer token, set http auth header , issue request to:
https://www.onenote.com/api/v1.0/myorganization/sitecollections/fromurl(url='https://mytenantxyz.sharepoint.com/sites/copynotesite')
for approx week, has been returning expected response, similar to:
{ "@odata.context": "https://www.onenote.com:576/api/v1.0/$metadata#microsoft.onenote.api.sitemetadata", "sitecollectionid": "111e03ac-468c-4a28-9aab-543098ef49bb", "siteid": "555d72a0-f82f-4e4c-ae8a-17ef0ea04f32" }
however, today has decided return following in approx 9 out of 10 requests:
{ error": { "code" : “20158”, "message": "unable sitemetadta url specified in request.", "@api.url": "http://aka.ms/onenote-errors#c20158" } }
the microsoft docs (link) explain error 20158 as:
"unable metadata site url specified in request. check format of supplied url. supported formats include https://domain.sharepoint.com/site-a , https://domain.com/sites/site-a. (sharepoint support in preview.)" unaware in preview more (i thought ga), anyway doesn't explain why intermittently works same input (same url , bearer token).
could bug in onenote api or sharepoint api must call under covers?
please refer blog - http://blogs.msdn.com/b/onenotedev/archive/2015/06/11/and-sharepoint-makes-three.aspx
we added fromurl method can pass in absolute site url , site collection , site ids. should make call when needed, , store values (site collection , site ids) future use in requests onenote api.
this not answer intermittency. please share x-correlationid header failing request can further.
Comments
Post a Comment