Last active
December 21, 2015 10:19
-
-
Save msrivastav13/6291230 to your computer and use it in GitHub Desktop.
SalesforcetoSalesforceConnectionOauthAutonomousClient
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
ublic class TestCallout { | |
public static void TestCallout(){ | |
String clientId = ''; | |
String clientSecret = ''; | |
String reqbody = 'grant_type=password&client_id='+clientId+'&client_secret='+clientSecret+'&username=username&password=password'; | |
Http h = new Http(); | |
HttpRequest req = new HttpRequest(); | |
req.setBody(reqbody); | |
req.setMethod('POST'); | |
req.setEndpoint('https://data-na3--data.cs13.my.salesforce.com/services/oauth2/token');//Note if my domain is set up use the proper domain name else use login.salesforce.com for prod or developer or test.salesforce.com for sandbox instance | |
HttpResponse res = h.send(req); | |
system.debug('--------'+res.getBody()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment