function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AbAb 

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 Ab
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