---
schema_version: "1"
id: d374a4d862e5ab167ecb5dd3159501605576bf51ee2d69a6dfb9ffccdbe8bdac
title: Getting Access Token for the User
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/retail_api/rtr_getting_access_token.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/rtr_getting_access_token.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 20a34de136463f89b930e4a92b80ce7e33ca4e0fe953ed875ced3a1016852deb
---
# 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:

curl --location --request POST 'https://login.salesforce.com/services/oauth2/token' \\
--header 'Content-Type: application/x-www-form-urlencoded' \\
--header 'Cookie: BrowserId=S0x8SC\_iEeu04d3AnIIK0w; CookieConsentPolicy=0:0' \\
--data-urlencode 'grant\_type=password' \\
--data-urlencode 'client\_id={{CONNECTED APP CLIENT ID}}' \\
--data-urlencode 'client\_secret={{CONNECTED APP CLIENT SECRET}}' \\
--data-urlencode 'username={{USERNAME}}' \\
--data-urlencode 'password={{PASSWORT}}'

## Sample Response:

{
"access\_token": "xyz!xyz",
"instance\_url": "xyz",
"id": "https://login.salesforce.com/id/xyz/xyz",
"token\_type": "Bearer",
"issued\_at": "1631625949723",
"signature": "xyz“
}