You need to sign in to do that
Don't have an account?
SFDC@Error
Post HTTP Request for external system
Hi Friends
How can i share my Post HTTP Request to external system in term of javascript.I have checked in postman and its create token and record ,but its not working when i will change same in javascripts format.So how to create access token in first hit and push record in second hit just like postman .
How can i share my Post HTTP Request to external system in term of javascript.I have checked in postman and its create token and record ,but its not working when i will change same in javascripts format.So how to create access token in first hit and push record in second hit just like postman .
var clientId = 'myconsumerkey'; var clientSecret = 'mysecretkey'; var authorizationBasic = $.base64.btoa(clientId + ':' + clientSecret); var request = new XMLHttpRequest(); request.open('POST', oAuth.AuthorizationServer, true); request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); request.setEndpoint('https://cs72.salesforce.com/services/oauth2/token'); request.setRequestHeader('Authorization', 'Basic ' + authorizationBasic); request.setRequestHeader('Accept', 'application/json'); request.send("username=admin&password=test&grant_type=password"); request.onreadystatechange = function () { if (request.readyState === 4) { alert(request.responseText); } };
this might help