Guest User

Untitled

a guest
Jan 24th, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. public static void test(){
  2.  
  3. String clientId = '3MVG9U_dUptXGpYIT.RB2JJXp.LMAoiYwISAmLt_9VcpgVnqVyUxS8qBvLAUugR1olAf3ysw5vDsO2fcr.TsQ';
  4. String clientsecret = '4163901141616295076';
  5. String username = 'stifel-rst@silverlinecrm.com.rstdev';
  6. String SecurityToken = 'dWB5m6BSUicCFGuQw5n1c0kB';
  7. String password = 's*******'+SecurityToken;
  8. String reqbody = 'grant_type=password&client_id='+clientId+'&client_secret='+clientsecret+'&username='+username+'&password='+password;
  9. Http h= new Http();
  10.  
  11. HttpRequest req= new HttpRequest();
  12. req.setBody(reqbody);
  13. req.setMethod('POST');
  14. req.setEndpoint('https://test.salesforce.com/services/oauth2/token');
  15. System.debug('request'+req.getBody());
  16. HttpResponse res=h.send(req);
  17. System.debug('res::'+res);
  18. }
Add Comment
Please, Sign In to add comment