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

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)'

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.