SOLVED

SPFx - Get all site collections

%3CLINGO-SUB%20id%3D%22lingo-sub-2035835%22%20slang%3D%22en-US%22%3ESPFx%20-%20Get%20all%20site%20collections%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2035835%22%20slang%3D%22en-US%22%3E%3CP%3EDear%20Ladies%20and%20Gentlemen%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ehow%20can%20I%20get%20all%20site%20collections%2C%20for%20which%20the%20logged%20in%20user%20has%20access%20rights%2C%20through%20SharePoint%20Framework%2C%20which%20works%20in%20Office%20365%20and%20in%20SharePoint%20on%20premise%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20very%20much%20for%20your%20help.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWith%20best%20regards%3C%2FP%3E%3CP%3ELadislav%20Stupak%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2035835%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAPIs%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPnP%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2036581%22%20slang%3D%22en-US%22%3ERe%3A%20SPFx%20-%20Get%20all%20site%20collections%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2036581%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F39836%22%20target%3D%22_blank%22%3E%40Beau%20Cameron%3C%2FA%3E%26nbsp%3Bthank%20you%20for%20your%20answer.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20I%20do%20it%20through%20the%20following%20method%20below%2C%20then%20I%20receive%20following%20error%3A%20%22Microsoft.SharePoint.Client.UnknownError%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3Epublic%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EGetAllSiteCollections2%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3Econtext%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EWebPartContext%3C%2FSPAN%3E%3CSPAN%3E%3A(%3C%2Fimg%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EPromise%3C%2FSPAN%3E%3CSPAN%3E%26lt%3B%3C%2FSPAN%3E%3CSPAN%3EISiteCollection%3C%2FSPAN%3E%3CSPAN%3E%5B%5D%3C%2FSPAN%3E%3CSPAN%3E%26gt%3B%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Elet%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3ErestApiUrl%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Estring%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%3D%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Econtext%3C%2FS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%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWhen%20I%20try%20it%20through%20following%20method%2C%20where%20I%20override%20the%20configuration%20version%2C%20then%20I%20receive%20as%20results%20an%20empty%20array.%20See%20print%20screen%20with%20the%20results%20log%20below%20the%20method.%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3Epublic%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EGetAllSiteCollections%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3Econtext%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EWebPartContext%3C%2FSPAN%3E%3CSPAN%3E%3A(%3C%2Fimg%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EPromise%3C%2FSPAN%3E%3CSPAN%3E%26lt%3B%3C%2FSPAN%3E%3CSPAN%3EISiteCollection%3C%2FSPAN%3E%3CSPAN%3E%5B%5D%3C%2FSPAN%3E%3CSPAN%3E%26gt%3B%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%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CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%2B%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Eerror%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%7D%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Search%20Site%20Collections%20Results%20empty.PNG%22%20style%3D%22width%3A%20715px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F244543i2E6A6CFA6244A3C3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Search%20Site%20Collections%20Results%20empty.PNG%22%20alt%3D%22Search%20Site%20Collections%20Results%20empty.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EThank%20you%20for%20help.%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWith%20best%20regards%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ELadislav%20Stupak%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Dear Ladies and Gentlemen,

 

how can I get all site collections, for which the logged in user has access rights, through SharePoint Framework, which works in Office 365 and in SharePoint on premise?

 

Thank you very much for your help.

 

With best regards

Ladislav Stupak

4 Replies

@LadislavStupak I would use the Search REST API to get all of the site collections.

_api/search/query?querytext='contentclass:sts_site'

@Beau Cameron thank you for your answer.

 

When I do it through the following method below, then I receive following error: "Microsoft.SharePoint.Client.UnknownError

 

public GetAllSiteCollections2(context: WebPartContext:( Promise<ISiteCollection[]> {

        let restApiUrl: string = context.pageContext.web.absoluteUrl + "/_api/search/query?querytext='contentclass:sts_site'";        
        
        let siteCollections: ISiteCollection[] = [];

        return new Promise<ISiteCollection[]>(async(resolve, reject) => {

            context.spHttpClient
                .get(restApiUrl, SPHttpClient.configurations.v1)
                .then((response: SPHttpClientResponse) => {
                    response.json().then((results: any) => {

                        console.log(restApiUrl);
                        console.log(results);

                        results.value.map((result: any) => {

                            siteCollections.push({
                                Title: result.Title,
                                SPSiteUrl: result.Url,
                            });
                        });

                        console.log(siteCollections);
                        resolve(siteCollections);                    
                    });
                }, (error: any:( void => {

                    reject("error occured " + error);
                });
        })
    }
 
When I try it through following method, where I override the configuration version, then I receive as results an empty array. See print screen with the results log below the method.
 
public GetAllSiteCollections(context: WebPartContext:( Promise<ISiteCollection[]> {

        let restApiUrl: string = context.pageContext.web.absoluteUrl + "/_api/search/query?querytext='contentclass:sts_site'";
                      
        const spSearchConfig: ISPHttpClientConfiguration = {

            defaultODataVersion: ODataVersion.v3
        };

        let siteCollections: ISiteCollection[] = [];

        return new Promise<ISiteCollection[]>(async(resolve, reject) => {

            context.spHttpClient
                .get(restApiUrl, SPHttpClient.configurations.v1.overrideWith(spSearchConfig))
                .then((response: SPHttpClientResponse) => {
                    response.json().then((results: any) => {

                        console.log(restApiUrl);
                        console.log(results);
                       
                        results.value.map((result: any) => {

                            siteCollections.push({
                                Title: result.Title,
                                SPSiteUrl: result.Url,
                            });
                        });

                        console.log(siteCollections);
                        resolve(siteCollections);                    
                    });
                }, (error: any:( void => {

                    reject("error occured " + error);
                });
        })
    }
 
Search Site Collections Results empty.PNG
 
Thank you for help.
 
With best regards
Ladislav Stupak
best response confirmed by LadislavStupak (Occasional Contributor)
Solution

This method is working well:

 

public GetAllSiteCollections5(context: WebPartContext:( Promise<ISiteCollection[]> {
        
        let restApiUrl: string = context.pageContext.web.absoluteUrl + "/_api/search/query?querytext='contentclass:sts_site'";

        let siteCollections: ISiteCollection[] = [];

        let config: SPHttpClientConfiguration = new SPHttpClientConfiguration({
            defaultODataVersion: ODataVersion.v3
        });

        return new Promise<ISiteCollection[]>(async(resolve, reject) => {

            context.spHttpClient
            .get(restApiUrl, config, {headers: { Accept: "application/json;odata=minimalmetadata;charset=utf-8"}})
            .then((response: SPHttpClientResponse) => {

                console.log("response contains: " + JSON.stringify(response));

                response.json().then((results: any) => {

                    console.log(restApiUrl);
                    console.log("results contains: " + JSON.stringify(results));
                    
                    let resultsList = results.PrimaryQueryResult.RelevantResults.Table.Rows;
                    
                    console.log(resultsList);
                    
                    resultsList.map((result: any) => {

                        console.log(result);

                        let cell3 = result.Cells[3];
                        console.log("cell3: " + JSON.stringify(cell3));

                        let cell6 = result.Cells[6];
                        console.log("cell6: " + JSON.stringify(cell6));

                        let cell3Value = cell3.Value;
                        console.log(cell3Value);

                        let cell6Value = cell6.Value;
                        console.log(cell6Value);

                        siteCollections.push({
                            Title: cell3Value,
                            SPSiteUrl: cell6Value,
                        });
                    });

                    console.log(siteCollections);
                    resolve(siteCollections);
                });
            }, (error: any:( void => {

                reject("error occured " + error);
            });
        })
    }

This method is better, because in case the restApiUrl contains some additional parameters, the position of Title and path in the cells array can change:

 

public GetAllSiteCollections5(context: WebPartContext:( Promise<ISiteCollection[]> {
        
        let restApiUrl: string = context.pageContext.web.absoluteUrl + "/_api/search/query?querytext='contentclass:sts_site'";
        
        let siteCollections: ISiteCollection[] = [];

        let config: SPHttpClientConfiguration = new SPHttpClientConfiguration({
            defaultODataVersion: ODataVersion.v3
        });

        return new Promise<ISiteCollection[]>(async(resolve, reject) => {

            context.spHttpClient
            .get(restApiUrl, config, {headers: { Accept: "application/json;odata=minimalmetadata;charset=utf-8"}})
            .then((response: SPHttpClientResponse) => {

                console.log("response contains: " + JSON.stringify(response));

                response.json().then((results: any) => {

                    console.log(restApiUrl);
                    console.log("results contains: " + JSON.stringify(results));
                    
                    let resultsList = results.PrimaryQueryResult.RelevantResults.Table.Rows;
                    
                    console.log(resultsList);
                    
                    resultsList.map((result: any) => {                        

                        let cells = result.Cells;
                        console.log("cells: " + JSON.stringify(cells));

                        let title: string = "";
                        let path: string = "";

                        cells.map((cell: any) => {

                            console.log("cell: " + JSON.stringify(cell));

                            let key = cell.Key;

                            if (key == "Title"{

                                title = cell.Value;
                            } else if (key == "Path"{

                                path = cell.Value;
                            }                         
                        });

                        siteCollections.push({
                            Title: title,
                            SPSiteUrl: path,
                        });
                    });

                    console.log(siteCollections);
                    resolve(siteCollections);
                });
            }, (error: any:( void => {

                reject("error occured " + error);
            });
        })
    }