You need to sign in to do that
Don't have an account?
Gaurav Dhandre
How can I get the access token using oauth?
I need to access the SHOPPER API which needs the access_token, but I didn't find the document which suggests how I can do that or any other alternate way to do it.
Thanks
Thanks
Do you need access token of salesforce?
Thanks,
Create a connected app: Go to Setup -> Create -> Apps -> Connected Apps -> New. Fill in the required fields and select the OAuth scopes that your app will need to access. Make sure to also select the appropriate OAuth Callback URL.
Obtain an authorization code: In order to obtain an access token, you need to first obtain an authorization code by sending a user to the Salesforce OAuth authorization endpoint. This can be done in a few ways, but one common way is to redirect the user to a Salesforce login page with the authorization endpoint URL and the necessary query parameters.
Exchange the authorization code for an access token: Once you have obtained an authorization code, you can exchange it for an access token by making a POST request to the Salesforce OAuth token endpoint. Include the authorization code, client ID, client secret, and redirect URI in the request body.
Here is some sample code that demonstrates how to obtain an access token using OAuth in Salesforce: