0

I use the following API

https://.sharepoint.com/_api/search/query?querytext='(contentclass=STS_Site)'&rowlimit=500

for getting the site collection, but it seems to miss site collections. for example : It misses

https://.sharepoint.com/sites/sep

. But for which I have all permissions. Even using the following api I was able to access the site

https://.sharepoint.com/_api/search/query?querytext='(path=https://.sharepoint.com/sites/sep)'

and checked

content class is STS_Site

P.S: It didn't cross the row limit what is wrong with my API. Or else is there is any REST API for getting only site collections.

Thanks & Regards, Sai Monesh C S

1 Answer 1

0

If you have created the site pretty soon, then you might have to wait till it is crawled. Have you tried this query?

https://(yourorg).sharepoint.com/_api/search/query?querytext='(contentclass=STS_Site AND path=https://(yourorg).sharepoint.com/sites/sep)'

1
  • What if I don't know the path and all I want is sitecollection.Also this is one of the old site collection Commented Mar 14, 2019 at 5:30

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.