+ Start a Discussion
SandrineSandrine 

simulation of code in Salesforce for a request in Postman

Hello,

I exeucte a postman request to get the token.

I was writing a code for authenticating the API in slaesforce, but found that the headers are not correct.

I tried to get the headers by other way.

User-added image

How can i write the code for first part of the screen shot,  ?
Best Answer chosen by Sandrine
Greg HGreg H
Here is a screenshot of the auth request I make using Postman.
Username-Password Authentication Flow
If you are authenticating against a sandbox then you'd POST to https://test.salesforce.com/services/oauth2/token but pass all the same key/value pairs. Hope this is helpful.
-greg