Create Connected App

  1. Go to Settings > Create > Apps.
  2. Click on New to create a Connected App.
  3. Fill in the required information
    1. App Name (then hit tab key to auto generate API name).
    2. Check Enable OAuth Settings.
    3. Check Enable for Device Flow (this will automatically populate Callback URL).
    4. Add OAuth Scopes the app will have access to.
      1. Click Save > Continue to create the app.


      2. Once the Connected App is created, a set <span style="color: #ff0000;"><span style="color: #ff6600;">Consumer Key</span></span> and <span style="color: #ff6600;">Consumer Secret</span> will get generated.
        Keep your <span style="color: #ff6600;"><strong>consumer key</strong></span> and <span style="color: #ff6600;">consumer secret </span>somewhere safe.
      3. To relax the IP address restriction, click on Manage > Edit Policies to modify the app’s policy setting.
        In the OAuth Policies section, set Permitted Users to All users may self-authorize, IP Relaxation to Relax IP restrictions for activated devices.
        In the Session Policies section, update Timeout duration if you want a token to expired after certain amount of time passed.PS: This step is optional.

      4. Click Save to update the settings.



      Buy Me a Coffee? Your support is much appreciated!

      Connect To Salesforce API In Python

      Before you can access any Salesforce REST API endpoint, the first thing (and most important piece of information) is to acquire an access token. An access token is basically a temporarily key to for an API service to grant permission to an app.

      To acquire an access token + make an API call with Python, use the script below.



      References

      1. Salesforce APIs and Integration.
      2. Salesforce APIs.
      3. Salesforce REST API Reference.