Teams related SharePoint sites not showing up

Leonid Roubbakh 0 Reputation points
2023-11-29T13:14:23.87+00:00

Hey,
To the best of my knowledge, when creating a "Microsoft Teams" team, a corresponding SharePoint site is also created.

I want to retrieve all of these sites.

I'm trying to use:

https://<my_company>.sharepoint.com/_api/search/query?querytext='contentclass:STS_Site contentclass:STS_Web'&sortlist='[docid]:ascending'&rowlimit=5000

SharePoint rest API call to retrieve all sites, and paginate through all results.

Paginating is done in the way explained here:

https://learn.microsoft.com/en-us/sharepoint/dev/general-development/pagination-for-large-result-sets

Yet, some of the sites seem absent.

(The sites that I mainly need are the ones that are associated with a "Microsoft Teams" team, but I want to be able to retrieve ALL SharePoint sites.)

  1. Is there some sort of a timeout until a site becomes accesable via REST API calls? I created the team almost 24 hours ago.
  2. Am I doing something wrong?

Thank you very much.

Microsoft 365 and Office | SharePoint | Development
Microsoft Teams | Development
Microsoft 365 and Office | SharePoint | For business | Windows
Microsoft Teams | Microsoft Teams for business | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2023-11-30T05:59:17.9666667+00:00

    Hi @Leonid Roubbakh,

    There are several reasons will cause the issue. For users not having been assigned site collection permissions with the "Edit" permission level (either direclty to the site or via the 'Members of' group plus the Office 365 group 'Members'), Teams attached modern teamsites cannot be found through global search or have its contents (like list items and files) be retrieved through document library search.

    Some setting also relate to crawl latency. You could refer to the following document to update your settings

    https://learn.microsoft.com/en-us/sharepoint/troubleshoot/search/search-results-missing


    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.


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.