function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
String clientId = '*************************************************************************************************; String clientSecret = '*********************'; String username = '****@*****.*****'; String password = '**************'; String token = '**************************************'; HttpRequest req = new HttpRequest(); req.setMethod('POST'); req.setEndpoint('https://login.salesforce.com/services/oauth2/token'); req.setBody('grant_type=password' + '&client_id=' + clientId + '&client_secret=' + clientSecret + '&username=' + EncodingUtil.urlEncode(username, 'UTF-8') + '&password=' + EncodingUtil.urlEncode(password, 'UTF-8')); Http http = new Http(); HTTPResponse res = http.send(req); System.debug('BODY: '+res.getBody()); System.debug('STATUS: '+res.getStatus()); System.debug('STATUS_CODE: '+res.getStatusCode()); System.debug('CONTENT_TYPE: '+res.getHeader('Content-Type'));
Please see example below
As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.
Thanks,
Alex