SharePoint 2013 Apps: Get list of site collections using REST API
Let me clear that it is not possible to fetch a list of site collection neither via REST nor by using JSOM. But there is a workaround i.e. by utilizing SharePoint Search Query REST/JSOM API. For that a basic search site collection should already be configured and crawled. Then in our code, we only need to specify the query contentclass:sts_site to return sites results. Following is the working code snippet that I used to achieve that: function GetAllSiteCollectionsInCurrentWebApp(currentUser) { var queryText = 'contentclass:sts_site'; var url = _spPageContextInfo.webAbsoluteUrl + "/_api/search/query?querytext='" + queryText + "'"; var executor = new SP.RequestExecutor(_spPageContextInfo.webAbsoluteUrl); executor.executeAsync({ url: url, method: "GET", headers: { "Accept": "application/json;odata=verbose" }, success: function (data) { //RetrieveSiteColl...