microsoft-graph-apionenote-apimicrosoft-graph-sdks

Fix for defects in OneNote API returned URLs?


It appears the OneNote API returns defective URLs to particular requests:

1) When fetching content from a shared notebook using the GET-RecentNotebooks API to first fetch the shared notebook, then using the POST-GetNotebookFromWebUrl API to get the required sections URL, a defective URL is returned, in the form https://graph.microsoft.com/v1.0/sites/,<ID>/onenote/notebooks/<ID>/sections. The deficiency is that a segment is missing, before the comma after the /sites/ segment, which should contain the URL for the SharePoint site itself.

2) In the returned content itself, resource endpoints have an incorrect segment: the segment following https://graph.microsoft.com/v1.0/) is incorrectly rendered as siteCollections instead of sites.

My questions: Can these defects be corrected in the OneNote API itself? Failing this, what is the best way for a developer to handle these defects?


Solution

  • We dealt with the first defect (a missing segment for the SharePoint site itself) by extracting the missing URL from the webURL and inserting it into the URL used to fetch content from a shared notebook (via the API GET operation).

    However, it now (11 March 2021) appears that Microsoft's OneNote API developers have remedied this defect themselves, with the result that our own remedy now results in a duplicated segment in the GET request URL e.g. oursite-my.sharepoint.comoursite-my.sharepoint.com.

    The remarkable thing is that this duplicated segment causes no problem to the API GET operation (verified in the Graph Explorer)! So we can only assume that the OneNote API developers have provided for our fix and strip out the duplicated segment!

    It'd be nice to have a comment on this by the OneNote API developers.