使用带有 MS Graph 的 weburl 获取 sharepoint siteurl [英] Get sharepoint siteurl using weburl with MS Graph
问题描述
我在 sharedpoint 托管了 onenote 笔记本.我有一个网址可以访问该笔记本.如何使用带有 MS Graph API 的 webUrl 检索 siteId 和 siteCollectionId.
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.
示例 webUrl 是 -
Sample webUrl is -
https://companyall-my.sharepoint.com/personal/ash_desh_company_com/Documents/Notebooks/Notebook1
推荐答案
如果您使用 这个过程 然后向下面发出请求你应该可以访问ids:
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
https://graph.microsoft.com/v1.0/shares/{encodedurl}/site?select=sharepointIds
例如,对于您提供的示例 URL,它看起来像:
As an example, for the example URL you provided it would look like:
https://graph.microsoft.com/v1.0/shares/u!aHR0cHM6Ly9jb21wYW55YWxsLW15LnNoYXJlcG9pbnQuY29tL3BlcnNvbmFsL2FzaF9kZXNoX2NvbXBhbnlfY29tL0RvY3VtZW50cy9Ob3RlYm9va3MvTm90ZWJvb2sx/site?select=sharepointIds
请注意,ID 是使用旧命名法返回的,因此 siteId = siteCollectionId 和 webId = siteId
Note that the ids are returned using the older nomenclature, so siteId = siteCollectionId and webId = siteId
这篇关于使用带有 MS Graph 的 weburl 获取 sharepoint siteurl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!