在站点/搜索呼叫上未返回根站点方面

时间:2018-03-26 14:53:21

标签: json microsoft-graph

调用Microsoft Graph /sites?search端点时,不会返回根网站构面。

以下是搜索示例:

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

它返回:

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites",
    "value": [{
        "createdDateTime": "2017-11-04T18:52:44Z",
        "id": "fakeau.sharepoint.com,0f736b6a-d7fa-498d-b13f-72af82d58b49,7c055ac7-0d31-4341-8158-8055950f37c8",
        "lastModifiedDateTime": "2017-11-14T23:21:51Z",
        "name": "fake Archive",
        "webUrl": "https://fakeau.sharepoint.com/sites/fake Archive",
        "displayName": "fake fake Archive"
    }]
}

没有根网站方面。如果我使用/site端点直接访问该网站:

https://graph.microsoft.com/v1.0/sites/fakeau.sharepoint.com,0f736b6a-d7fa-498d-b13f-72af82d58b49,7c055ac7-0d31-4341-8158-8055950f37c8

我收到回复:

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites/$entity",
    "createdDateTime": "2017-11-14T23:19:51.437Z",
    "description": "",
    "id": "fakeau.sharepoint.com,0f736b6a-d7fa-498d-b13f-72af82d58b49,7c055ac7-0d31-4341-8158-8055950f37c8",
    "lastModifiedDateTime": "2018-03-23T12:23:40Z",
    "name": "fake Archive",
    "webUrl": "https://fakeau.sharepoint.com/sites/fake Archive",
    "root": {},
    "siteCollection": {
        "hostname": "fakeau.sharepoint.com"
    },
    "displayName": "fake fake Archive"
}

请注意,这现在有一个根网站方面。

这是一个错误,还是某些情况下根网站方面不应显示在/sites?search结果中?

1 个答案:

答案 0 :(得分:0)

sites/search endpoint仅返回网站属性的一小部分:

idnamedescriptioncreatedDateTimelastModifiedDateTimewebUrl

要检索完整元数据,您需要向/sites/{id}端点发出后续请求。