Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Getting Access Token for the User
To perform subsequent requests to the Integration API, you must get an access token for accessing the Integration API. You can get access tokens in multiple ways before sending requests to the RTR API endpoints. This example uses the simple username-password combination (not recommended in non-DEV environments). The response contains "access_token", which is needed for subsequent requests.
cURL example:
1curl --location --request POST 'https://login.salesforce.com/services/oauth2/token' \
2--header 'Content-Type: application/x-www-form-urlencoded' \
3--header 'Cookie: BrowserId=S0x8SC_iEeu04d3AnIIK0w; CookieConsentPolicy=0:0' \
4--data-urlencode 'grant_type=password' \
5--data-urlencode 'client_id={{CONNECTED APP CLIENT ID}}' \
6--data-urlencode 'client_secret={{CONNECTED APP CLIENT SECRET}}' \
7--data-urlencode 'username={{USERNAME}}' \
8--data-urlencode 'password={{PASSWORT}}'Sample Response:
1{
2"access_token": "xyz!xyz",
3"instance_url": "xyz",
4"id": "https://login.salesforce.com/id/xyz/xyz",
5"token_type": "Bearer",
6"issued_at": "1631625949723",
7"signature": "xyz“
8}