Working with Salesforce apps

  1. Within the setup panel, on left hand side click on AppsApp Manager. Click on New Connected App. You may need admin access to see this.

  1. Fill out the necessary info information.
    1. Make sure that Enable Oauth Settings and Enable Client Credentials Flow are turned on. For oauth scopes, we recommend that you include Full Access in Selected Oauth Scopes during the testing phase.
    2. For the Contact email, it will have to be the email of a user in the salesforce environment that you have the login access to as you will need to provide the password later in the API authentication process.

  1. Get the client id and client secret for prelim to make requests. To do this, go back to App Manager, find the connected app you just added, click on the arrow on the rightmost side and select View. In the following page, click on Consumer Key and Secret to view the client id and client secret.

  1. To get authentication working from a prelim perspective so that Prelim can make requests, create a new connection. You will need to fill out a few fields

    1. Base Url - Modify and paste the following snippet:
    https\://<YOUR SALESFORCE BASE URL>.my.salesforce.com
    
    1. Headers - Select Raw and paste the following snippet in
      {"Authorization":"Bearer {{ auth1.body.access_token }}","Content-Type":"application/json"}
    2. Authentication - Select Custom. For Method select Post. Paste in the following snippet for Url, making edits as necessary. Use test.salesforce for demo, and login.salesforce for production. For the password parameter, if there exists a security token, you will need to append that to the end of your password. For example, if your password is 123password and your security token is abc your password will be 123passwordabc.
    --------SANDBOX URL--------
    https://test.salesforce.com/services/oauth2/token?username=<YOUR_USERNAME>&grant_type=password&client_id=<YOUR_CLIENT_ID>&client_secret=<YOUR_CLIENT_SECRET>&password=<YOUR_PASSWORD>
    ---------------------------
    
    --------PRODUCTION URL--------
    https://login.salesforce.com/services/oauth2/token?username=<YOUR_USERNAME>&grant_type=password&client_id=<YOUR_CLIENT_ID>&client_secret=<YOUR_CLIENT_SECRET>&password=<YOUR_PASSWORD>
    ------------------------------
    

    iii. Paste in the following snippet for Headers under Authentication

    {"Content-Type":"application/x-www-form-urlencoded"}
    
  2. You should now be able to make API calls to your salesforce app by adding interactions. To learn more about this, please look over salesforce's guide on adding/updating objects: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_rest.htm