Created
September 11, 2018 08:26
-
-
Save Patlatus/296a26496abf1bfa78f452afc823ed50 to your computer and use it in GitHub Desktop.
URLService
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
<!-- <pre> | |
public class URLService { | |
@auraEnabled | |
public static String getBaseURL() { | |
PageReference pr = new PageReference('/id/' + UserInfo.getOrganizationId() + '/' + UserInfo.getUserId() + '?oauth_token=' + UserInfo.getSessionId() ); | |
System.debug(LoggingLevel.ERROR, '@@@ v: ' + pr.getContent().toString() ); | |
String data = pr.getContent().toString(); | |
Map result = (Map)Json.deserializeUntyped(data); | |
Map urls = (Map)result.get('urls'); | |
System.debug(LoggingLevel.ERROR, '@@@ v: ' + (String)urls.get('rest') ); | |
String rest = (String)urls.get('rest'); | |
String[] items = rest.split('/'); | |
return items[0] + '//' + items[2] + '/'; | |
} | |
} | |
</pre> --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment