requestToken Reference for Legacy Packages
This document applies only to API integrations in legacy packages. To get an access token for OAuth 2.0 API integrations, review Set Up Your Development Environment for Enhanced Packages.
For your authentication requests, we recommend that you use a tenant-specific endpoint, which includes your tenant’s subdomain. Find your endpoints in Installed Packages. New and existing customers on S1 through S10 can continue to use https://auth.exacttargetapis.com.
To obtain an OAuth token, perform an HTTP POST that includes your client ID and client secret in the request body.
Query Parameters
| Name | Type | Description |
|---|---|---|
legacy | Boolean | Set to 1 to return a legacy token. |
JSON Parameters
The JSON object in the request body has these properties.
| Name | Type Description |
|---|---|
clientID | String |
clientSecret | String |
accessType | String |
refreshToken | String |
Example Request for Production
1//Request token for a Production environment https://mc.exacttarget.com.
2
3POST https://YOUR_SUBDOMAIN.auth.marketingcloudapis.com/v1/requestToken
4Content-Type: application/json
5{
6 "clientId": "YOUR_CLIENT_ID",
7 "clientSecret": "YOUR_CLIENT_SECRET"
8}Example Request for Testing
1//Request token for a Production Support (sandbox) environment https://mc.test.exacttarget.com.
2
3POST https://auth-test.exacttargetapis.com/v1/requestToken
4Content-Type: application/json
5{
6 "clientId": "YOUR_CLIENT_ID",
7 "clientSecret": "YOUR_CLIENT_SECRET"
8}Example Response
The HTTP POST with valid values for clientID and clientSecret returns two values:
- accessToken - An OAuth token passed to subsequent API requests.
- expiresIn - The expiration period of the OAuth token in seconds. The default value of 3600 seconds cannot be changed.
1{
2 "accessToken": "YOUR_TOKEN",
3 "expiresIn": 3600
4}Example Request for SSO
1//Request token for an app.
2
3POST https://YOUR_SUBDOMAIN.auth.marketingcloudapis.com/v1/requestToken
4Content-Type: application/json
5{
6 "clientId": "YOUR_CLIENT_ID",
7 "clientSecret": "YOUR_CLIENT_SECRET",
8 "refreshToken": "YOUR_TOKEN",
9 "accessType": "offline"
10}Example Response for SSO
1{
2 "accessToken": "YOUR_ACCESS_TOKEN",
3 "expiresIn": 3600,
4 "refreshToken": "YOUR_REFRESH_TOKEN"
5}Related Items
- SSO for Marketing Cloud Engagement Apps
- Your Subdomain and Your Tenant’s Endpoints
- Salesforce Help: Determine Your Marketing Cloud Engagement Instance