Well, according to the documentation, only application permissions are supported for that query, so it shouldn't even work in the Graph explorer. Not sure if bug, improperly documented feature or anything else, but I will ping few people as it's interesting to know the answer here :)
Why does https://graph.microsoft.com/v1.0/sites need a blank search parameter to return a list of sites?
According to docs, you should be able to make a request to https://graph.microsoft.com/v1.0/sites
and get a list of your Sharepoint sites back. Both in the Graph API explorer and with my own HTTP requests, this seems to always return an empty list.
However, if I add a blank search
parameter (i.e. make a request to https://graph.microsoft.com/v1.0/sites?search=
), I do get all of my sites back.
Is that a bug or a feature? Do you need to include an empty search
parameter for other endpoints in the Graph API?
Thanks! Taylor
2 answers
Sort by: Most helpful
-
-
RaytheonXie_MSFT 36,731 Reputation points Microsoft Vendor
2023-01-30T01:58:19.8833333+00:00 Per my research,
https://graph.microsoft.com/v1.0/sites
only support Application permission. So we are unable to callGET /sites
in the graph explorer tool.And in the search for sites document, this is a different endpoint with
GET /sites
. The endpoint supportDelegated (work or school account)
. So we will get result in the graph explorer tool whileGET /sites
returns empty.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.