Created
August 27, 2018 18:48
-
-
Save choudharymanish8585/20d0c407735b1156e5dad62a457dc038 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* Class to demo new Url.getOrgDomainUrl() and UserInfo.getSessionId() methods | |
*/ | |
public class SameOrgApiDemo{ | |
//This method will make a call to same org | |
public static void getOrgLimits(){ | |
Http h = new Http(); | |
HttpRequest req = new HttpRequest(); | |
req.setEndpoint(Url.getOrgDomainUrl().toExternalForm() | |
+ '/services/data/v44.0/limits'); | |
req.setMethod('GET'); | |
req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId()); | |
HttpResponse res = h.send(req); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment