Forum Discussion
Ralf Friedrich
Mar 14, 2018Copper Contributor
How to get the site collection List using REST or CSOM?
Hi all,
we would like to get a list of all site collections using REST or CSOM with JavaScript. We used the REST call /_api/search/query? querytext=' contentclass: sts_site' &trimduplicates=false&selectproperties=' Title, SPWebUrl, WebTemplate, Description'", but not all site collections are returned.
Specially created site collections will not be returned. But even some of the site collections that have been created for a long time are not listed.
The call is done from a script in an Azure Web App.
the current user is site collection administrator in all site collections.
Is there a reason for this?
And how can we solve this?
Regards,
Ralf
- Ralf FriedrichCopper Contributor
- Deleted
What url are you using in front of your api? are you using https://tenantname-admin.sharepoint.com/api or?
- Ralf FriedrichCopper Contributor
I use https://tenantname.sharepoint.com/_api/ because the user should not have access to the administration.