gpt4 book ai didi

sharepoint - 使用 graph api beta 获取 Sharepoint 管理中心中列出的所有根站点

转载 作者:行者123 更新时间:2023-12-05 01:29:47 25 4
gpt4 key购买 nike

我需要图像中显示的共享点管理中心中列出的所有根站点 enter image description here

为此,我正在使用如下的 Graph api,

var settings = {
"async": true,
"crossDomain": true,
"url": "https://graph.microsoft.com/beta/sharepoint/sites",
"method": "GET",
"headers": {
"authorization": "Bearer token",
"cache-control": "no-cache",
"postman-token": "3116b007-e574-5ad4-aedd-3b35fbf76b61"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});

但是它给出的输出如下,

{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#sharePoint/sites",
"value": [
{
"createdDateTime": "2017-02-18T13:03:01.263Z",
"description": "",
"id": "2422c3a2-3c51-40f1-8483-5454aead43c4,412bb897-c754-460a-962d-db22893a1649",
"lastModifiedDateTime": "2017-04-24T02:16:43Z",
"name": "",
"webUrl": "https://mps330124.sharepoint.com",
"root": {},
"siteCollection": {
"hostname": "mps330124.sharepoint.com"
},
"siteCollectionId": "2422c3a2-3c51-40f1-8483-5454aead43c4",
"siteId": "412bb897-c754-460a-962d-db22893a1649"
}
]
}

我如何使用 graph api beta 实现它

最佳答案

在站点搜索端点上使用星号似乎可行

https://graph.microsoft.com/v1.0/sites?search=*

返回

{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites",
"value": [
{
"createdDateTime": "2017-09-15T01:11:50Z",
"description": "Let's capture our thoughts in this subsite blog.",
"id": "xyz.sharepoint.com,5a58bb09-1fba-41c1-8125-69da264370a0,5e9767b8-95bc-4bd1-aeb0-defabcdefabc",
"lastModifiedDateTime": "0001-01-01T08:00:00Z",
"name": "internalblogs",
"webUrl": "https://xyz.sharepoint.com/internalblogs",
"displayName": "Internal blog"
},
{
...
}]
}

关于sharepoint - 使用 graph api beta 获取 Sharepoint 管理中心中列出的所有根站点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43629902/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com