1 / 10

How to Generate an Access Token to Access Salesforce org

Learn how to quickly generate an access token to connect with your Salesforce org using OAuth2. First, create a Salesforce Developer account if you donu2019t already have one. Then, set up a Connected App within Salesforce to enable OAuth settings. Collect essential credentials such as the Consumer Key, Consumer Secret, Username, and Security Token. Finally, use Postman to obtain the access token by sending a POST request with your credentials. Follow these steps for seamless integration with Salesforce APIs!

Download Presentation

How to Generate an Access Token to Access Salesforce org

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. How to Generate an Access Token to Access Salesforce Org A step-by-step guide to obtaining OAuth2 tokens from Salesforce REST API

  2. Overview • We'll walk you through the steps to generate OAuth2 tokens from Salesforce REST API. • This process requires creating a Salesforce account, configuring a Connected App, and obtaining necessary credentials like Consumer Key, Consumer Secret, and Security Token.

  3. Create Your Salesforce Account • You can use a paid Salesforce account or create a Salesforce Developer Edition. • Important: Don’t use a free trial account as it may not allow API access.

  4. Creating a Connected App • Log in as an administrator. • Select Setup from the dropdown in the upper-right corner. • Navigate to Home > Quick Find > App Manager. • Click New Connected App in the upper-right corner.

  5. Enter Required Fields • Enter basic fields like App Name, API Name, and Contact Email. • Navigate to the API (Enable OAuth Settings) section. • Check the Enable OAuth Settings box. • Enter https://login.salesforce.com/ as the Callback URL. • Select the following OAuth Scopes: • Access and manage your data (API) • Perform requests on your behalf at any time (refresh token, offline access) Provide access to your data over the web (web) • Click Save.

  6. Manage Your Connected App • Go back to the Connected App list and click Manage from the dropdown. • On the new page, click Edit. • Under OAuth regulations, select All users may self-authorize. • Click Save.

  7. Obtain Consumer Key and Secret • From the API (Enable OAuth Settings) section, note down: • Consumer Key • Consumer Secret • You’ll need these for the next steps.

  8. Get Your Security Token • Click the profile icon (upper right corner). • Go to Settings > My Personal Information > Reset My Security Token. • You’ll receive the Security Token via email.

  9. Obtaining Access Token via Postman Open Postman and create a POST request to: https://{{paste-your-domain}}/services/oauth2/token Paste your credentials in the request body: • grant_type = password • client_id = [Consumer Key] • client_secret = [Consumer Secret] • username = [Your Salesforce Username] • password = [Your Password] + [Security Token] Send the request to get your Access Token.

  10. Conclusion • You've successfully created a Connected App and generated an access token for your Salesforce account. • Use the Access Token to authenticate your API calls. • Follow Us for more helpful posts and tips.

More Related