Finding Graph API that return same site as SharePoint Admin Center

Casepoint Developer 66 Reputation points
2023-02-16T13:35:52.5266667+00:00

Hi There,

We are eDiscovery company and wanting to provide functionality where Admin user can get all the share point APIs of the specified custodian.

We want Admin can get all the SharePoint sites of the specific custodians

User's image

We tried with two approaches

  1. Share Points APIs API Count : https://{tenant-id}/_api/web/lists/getbytitle('DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECOLLECTIONS')/itemcount
    Result : 1869
    API Sites : https://{tenant-id}/_api/web/lists/getbytitle('DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECOLLECTIONS')/items Result : List of sites pagination wise
  2. Graph APIs
    API : https://graph.microsoft.com/v1.0/sites
  3. App Permission as below :
  4. Result : API does not return sites which we are getting from the SharePoint APIs

User's image

We refer Microsoft Documentation

We tried search option too for API : https://graph.microsoft.com/v1.0/sites?search=*

However we did not the same site count

User's image

Can you please assist us Site which we are currently seeing in SharePoint admin center those same sites we retrieve from Graph API

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,264 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,230 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. CharanyaB-MSFT 1,891 Reputation points Microsoft External Staff
    2023-02-16T20:55:21.34+00:00

    Hello @Casepoint Developer,

    Thanks for reaching out!

    I see that you are using /sites API in Graph explorer which uses a delegated permission type.

    But, List sites API currently supports only Application permissions. Please refer the below screenshot. I suggest you try this API with application permissions.

    User's image

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.