我正在关注此处的文档https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/resources/sharepoint
我想枚举默认网站的列表 .
-
得到
siteId
使用/sharePoint/site
终点(工作正常) -
使用
sharePoint/sites/{{siteId}}/lists
的请求列表不起作用返回404
以及以下消息
{ "error": { "code": "itemNotFound", "message": "Requested site could not be found", "innerError": { "request-id": "34b1b51a-59ba-4c56-991a-319ffbe33005", "date": "2017-04-07T10:46:40" } } }
任何指针
2 回答
我假设您已确认此网站中有一个列表 . 如果您尝试从没有一个站点的站点获取列表集合,您将获得404 .
更可能是你使用了错误的ID . 文档对
{site-id}
所指的属性有点含糊不清 .当您获取网站时,将同时存在
siteId
和id
属性 . 你想要id
属性 . 使用siteId
将导致404 .在
sharePoint/sites/{{siteId}}/lists
{siteId}
的一部分实际上是3部分,域,根网站ID,子网站ID,例如,如果我有一个域contoso.sharepoint.com
,一个名为root site
的网站,ID为123
(它应该是一个guid),另一个子网站在名为Klingon Site
的id为145
所以我的最终{siteId}
是contoso.sharepoint.com,123,145
应该像
contoso.sharepoint.com,fffdf23f-1234-1234-a744-17e2e196e777,1481eca1-4567-4567-8dbc-60c666ab3b8c