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

//Request token for a Production environment https://mc.exacttarget.com.

POST https://YOUR_SUBDOMAIN.auth.marketingcloudapis.com/v1/requestToken
Content-Type: application/json
{
  "clientId": "YOUR_CLIENT_ID",
  "clientSecret": "YOUR_CLIENT_SECRET"
}

Example Request for Testing

//Request token for a Production Support (sandbox) environment https://mc.test.exacttarget.com.

POST https://auth-test.exacttargetapis.com/v1/requestToken
Content-Type: application/json
{
  "clientId": "YOUR_CLIENT_ID",
  "clientSecret": "YOUR_CLIENT_SECRET"
}

Example Response

The HTTP POST with valid values for clientID and clientSecret returns two values:

  1. accessToken - An OAuth token passed to subsequent API requests.
  2. expiresIn - The expiration period of the OAuth token in seconds. The default value of 3600 seconds cannot be changed.
{
  "accessToken": "YOUR_TOKEN",
  "expiresIn": 3600
}

Example Request for SSO

//Request token for an app.

POST https://YOUR_SUBDOMAIN.auth.marketingcloudapis.com/v1/requestToken
Content-Type: application/json
{
  "clientId": "YOUR_CLIENT_ID",
  "clientSecret": "YOUR_CLIENT_SECRET",
  "refreshToken": "YOUR_TOKEN",
  "accessType": "offline"
}

Example Response for SSO

{
  "accessToken": "YOUR_ACCESS_TOKEN",
  "expiresIn": 3600,
  "refreshToken": "YOUR_REFRESH_TOKEN"
}

Related Items