Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void test(){
- String clientId = '3MVG9U_dUptXGpYIT.RB2JJXp.LMAoiYwISAmLt_9VcpgVnqVyUxS8qBvLAUugR1olAf3ysw5vDsO2fcr.TsQ';
- String clientsecret = '4163901141616295076';
- String username = 'stifel-rst@silverlinecrm.com.rstdev';
- String SecurityToken = 'dWB5m6BSUicCFGuQw5n1c0kB';
- String password = 's*******'+SecurityToken;
- 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://test.salesforce.com/services/oauth2/token');
- System.debug('request'+req.getBody());
- HttpResponse res=h.send(req);
- System.debug('res::'+res);
- }
Add Comment
Please, Sign In to add comment