none
Unable to list team sites in sharepoint using graph API RRS feed

  • Question

  • Hi

    I am listing all sites from sharepoint using rest API as the following.

    GET https://graph.microsoft.com/beta/sharepoint/sites/{site-id}/sites

    I am able to list all sites in the old version (not team sites).

    But now, the sites on the main page is changed to team sites, which are not listed, is there any way to list all the team sites (including team sites and old personal sites)?



    • Edited by wimphy Friday, April 14, 2017 1:37 AM
    Friday, April 14, 2017 1:35 AM

Answers

All replies

  • Hi,

    Per my knowledge, this API will list all the subsites inside a specific site collection. In my test, all the subsite inside the site collection I specified were listed successfully.

    How did you set the {site-id} value in this API?

    What did you mean by the old version? Could you please provide more details about the site which are not listed?

    And it would be better if you can also provide the site collection structure here for better understanding your issue.

    Best Regards,

    Victoria

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, April 17, 2017 5:07 AM
    Moderator
  • Hi Victoria

    Thanks for response.

    The old version I meant is as the following link, which creates a personal site

    https://*-my.sharepoint.com/personal/*/Social/Sites.aspx

    And the new version is as the following link, which creates team site

    https://*.sharepoint.com/_layouts/15/sharepoint.aspx

    I created an old version of site with sub sites, and a new version of site without sub sites (I cannot find a way to create the sub sites for new version)

    And I invoked REST API, trying to get the root site using below link, and received only one response.

    GET https://graph.microsoft.com/beta/sharepoint/site

    Then I requested its sub sites using the id above returned. It list all those old version sub sites

    GET https://graph.microsoft.com/beta/sharepoint/sites/{site-id}

    So the issue is that I have no way to list the new version of team site




    • Edited by wimphy Wednesday, April 19, 2017 2:29 AM
    Wednesday, April 19, 2017 2:02 AM
  • Hi,

    To get the modern team sites for the groups, we need to use groups end point from Microsoft Graph.

    However, there is no API to list all the modern team sites directly, we can loop through the groups and then get the site URL with this API: https://graph.microsoft.com/v1.0/groups/<group-id>/drive/root/webUrl.

    Please check the link below for more details:

    https://www.eliostruyf.com/get-the-site-url-of-an-office-365-group-via-the-microsoft-graph/

    Best Regards,

    Victoria


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Marked as answer by wimphy Thursday, April 27, 2017 3:21 PM
    Wednesday, April 26, 2017 5:35 AM
    Moderator
  • Thanks, this is what I want~
    Thursday, April 27, 2017 3:22 PM