使用带有 MS Graph 的 weburl 获取 sharepoint siteurl [英] Get sharepoint siteurl using weburl with MS Graph

查看:77
本文介绍了使用带有 MS Graph 的 weburl 获取 sharepoint siteurl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 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!aHR0cHM6Ly9jb21wYW55YWxsLW15LnNoYXJlcG9pbnQuY29tL3BlcnNvbmFsL2FzaF9kZXNoX2NvbXBhbnlfY29tL0RvY3YJbZ0a^3VtxMtZaRvY0CybZ03RvY0CybZ03RvY09VtZmTvZaVts

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆