Created
May 2, 2020 06:18
-
-
Save lukethacoder/ee2a95ce9f52bfe412f0ff99d17065cd to your computer and use it in GitHub Desktop.
Apex code to query a list of communities and their high level metadata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ConnectApi.CommunityPage queryAllTheCommunities = ConnectApi.Communities.getCommunities(); | |
System.debug('queryAllTheCommunities ' + queryAllTheCommunities.communities); | |
for (ConnectApi.Community community : queryAllTheCommunities.communities) { | |
System.debug('--------------------------------------------------'); | |
System.debug('id ' + community.id); | |
System.debug('name ' + community.name); | |
System.debug('description ' + community.description); | |
System.debug('siteUrl ' + community.siteUrl); // https://your-salesforce-sites-url.cs46.force.com/custom_site | |
System.debug('url ' + community.url); // /services/data/v48.0/connect/communities/0DB9A0000003eW9LWC | |
System.debug('urlPathPrefix ' + community.urlPathPrefix); // custom_site | |
System.debug('status ' + community.status); | |
System.debug('templateName ' + community.templateName); | |
System.debug('--------------------------------------------------'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment