Newer Version Available

This content describes an older version of this product. View Latest

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}