0

I am trying to list all of the sites in a particular tenant simply using https://graph.microsoft.com/v1.0/sites from https://learn.microsoft.com/en-us/graph/api/site-list?view=graph-rest-1.0&tabs=http documentation.

However, when I do a get request, my value fields are empty. There are SharePoint sites on this tenant.

The API has Reports.Read.All and Sites.Read.All with admin permissions granted. This is odd since when I attempt to list all root sites, I get a 403 forbidden error.

enter image description here

enter image description here

enter image description here

Used postman to check my API permissions.

1
  • Did you double check access_token? Commented May 27, 2024 at 12:06

1 Answer 1

0

I have found the answer. I am using the incorrect GET request. Would be good if Microsoft could update their documentation.

https://learn.microsoft.com/en-us/graph/api/site-getallsites?view=graph-rest-1.0&tabs=http

Instead of GET /sites as documented in https://learn.microsoft.com/en-us/graph/api/site-list?view=graph-rest-1.0&tabs=http I need to use GET /sites/getAllSites.

Thank you Microsoft.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.