I have onenote notebooks hosted at sharedpoint. I have a weburl to access that notebook. How I can retrieve siteId and siteCollectionId using webUrl with MS Graph API.
Sample webUrl is -
https://companyall-my.sharepoint.com/personal/ash_desh_company_com/Documents/Notebooks/Notebook1
If you encode the webUrl
using this process and then make a request to the following you should be able to access the ids:
https://graph.microsoft.com/v1.0/shares/{encodedurl}/site?select=sharepointIds
As an example, for the example URL you provided it would look like:
Note that the ids are returned using the older nomenclature, so siteId = siteCollectionId and webId = siteId