Import the accompanying insomnia_salesforceAPI.json
into Insomnia to create a workspace with sample requests that,
- get a bearer token using Salesforce built-in Oauth password workflow
- make REST API requests referencing the bearer token
The environment variables are stored in MyOrg
folder.
These environment values will be peculiar to your SF installation:
host
: url of your Salesforce orgusername
: your Salesforce usernamepassword
: your Salesforce passwordsecurityToken
: your Salesforce security tokencId
: Consumer Key of an Oauth-enabled Connected App in SalesforcecSecret
: Consumer Secret of an Oauth-enabled Connected App in Salesforce
These environment values are probably correct as-is, and will change only with SF releases:
ep
: Salesforce API endpoint pathv
: Salesforce API versionlogin_server
: url of the built-in Salesforce auth token service for Oauth password flow
You may have to re-link the Bearer token of the sample GET request (see 'Get sobjects/account/describe' in the next section) to the response of the Oauth token request (see 'Get Bearer Token' in the next section). For details, refer to the Insomnia documentation.
- Obtain an API bearer token by executing the first request, 'Get Bearer Token'
- this request references the environment values to request a bearer token from the built-in Salesforce token service, using Oauth password flow
- Request a description of the Account sObject by executing the sample request, 'Get sobjects/account/describe'
- this request references the bearer token obtained by 'Get Bearer Token'
To create additional API requests, duplicate 'Get sobjects/account/describe' and adjust the url / query parameters as necessary