我正在使用Office 365。我已经在 SharePoint 上创建了多个网站。我想以编程方式获取所有站点和站点 ID 的列表(使用 c#(。
我使用过GraphServiceClient "await m_GraphClient.Groups.Request((。GetAsync((".
但是我想知道获取网站列表的更多方法。
你可以尝试搜索。
https://graph.microsoft.com/v1.0/sites?search=*
在 SPFx 中的示例
this.props.context.msGraphClientFactory
.getClient()
.then((client: MSGraphClient): void => {
client
.api("sites?search=*")
.version("v1.0")
.get((error, response: any, rawResponse?: any) => {
console.log(response);
});
})