Renstrah
Renstrah

Reputation: 46

Microsoft Graph Sharepoint subsite list

Is it possible get list and items of a subsite in SharePoint using the Microsoft Graph?

There is a way to get a subsite but not the items of a subsite.

Upvotes: 2

Views: 3444

Answers (1)

Dmitry Pimenov
Dmitry Pimenov

Reputation: 739

Once you have a subsite, you can make subsequent queries by using the identifier of that subsite.

For instance, if I fetch https://graph.microsoft.com/v1.0/sites/root/sites, I can see the subsites available, each of which has an id.

I can then make a subsequent query to https://graph.microsoft.com/v1.0/sites/<subsite id>/lists to fetch the lists for this sub-site.

It is also possible to use OData query options and request the 'lists' for each sub-site expanded in the request to get subsites. I can make a call to https://graph.microsoft.com/v1.0/sites/root/sites?$expand=lists and see entries for each of their sub-sites, and also their lists.

Upvotes: 3

Related Questions