Explanation of the Decoded JWT
After you decode the JWT, the JSON request body resembles this example.
For multi-tenant applications, such as apps on AppExchange, the
apiEndpointBase values are the endpoints for the current tenant.
|The exp (expiration time) claim identifies the expiration time on or after which the token MUST NOT be accepted for processing. Contains an IntDate value in UTC.
|The version of the JWT claims structure. Possible values are
1 (legacy version) or
2 (default version for all new apps).
|Contains the request token URL for the environment or region. For multi-tenant applications, it can contain a tenant-specific endpoint. For example,
|Contains the base URL for REST API. For multi-tenant applications, it can contain a tenant-specific endpoint. For example,
|An OAuth refresh token for getting an updated access token. The refreshToken is valid for up to 700 days or until it has been used. If the token expires, inform the user to log out and log back in. This process generates a new refresh token for your app. If the refreshToken was used previously, you receive a 401 Unauthorized. The refreshToken has a 5-minute revocation period after use, allowing for more attempts in case the auth service doesn't respond immediately. If your package doesn't have an API Integration component, you don't receive a refreshToken.
|The user ID.
|This field isn't used in claims version 2. An OAuth token that can access REST Services for the user. The token is valid for 1 hour. For more information, see Get an Access Token.
|This field isn't used in claims version 2. An OAuth token that can access SOAP API. It’s also referred to as the legacyToken.
|This field isn't used in claims version 2. An OAuth refresh token for getting an updated oauthToken. Refresh tokens expire after 700 days or after they’ve been used. When the token expires, inform the user to log out and log back in. This process generates a new refresh token for your app.
|This field isn't used in claims version 2. Length in seconds before the token expires. A value of
1200 is equal to 20 minutes, for example.
|The email address of the user.
|The culture code of the user.
|The friendly name of the user's timezone.
|The timezone code of the user.
|The Greenwich Mean Time (GMT) offset.
|Is Daylight Savings Time (DST) applied to this timezone setting?
|The account ID. For agency sub-accounts, this ID is the agency client ID and must match the value for the enterprise ID. For enterprise sub-accounts, ID this is the sub-account ID and can be different from the enterprise ID.
|The top-level enterprise account ID. For agency sub-accounts, use the agency client ID for the enterprise ID.
|The data context value represents the edition of the account. Possible values are
core (Marketing Cloud Core or Advanced Edition),
reseller (Marketing Cloud Agency or Agency Client),
tiered (Marketing Cloud Enterprise Edition), and
enterprise (Marketing Cloud Enterprise 2.0 Edition)
|The server instance that the account is on. Usual production values are
S50. Used when making Email SOAP API calls to set the appropriate web service end point.
|The currently supported data center regions are
|The package ID of your application. This value is in the installed package details.
|Distinguishes between production and development environments.
|The URL you set for the home page of your application in the installed package. This URL is where you forward the user upon successful completion of SSO through your login page.
Be aware of these restrictions in your implementation code when using the refreshToken to refresh the OauthToken (access token) that is about to expire and keep it contextualized to the logged-in user:
The app must be installed in the account you use to log in. If logging in via Marketing Cloud Engagement and selecting the app from the AppExchange listings, the app is installed in the correct account.
Only use the
refreshTokenparameter in the request body if you need a new contextualized token.
Each time you get a new access token, include a request to GET /platform/v1/endpoints. This request ensures that your app is calling the correct customer endpoints.
If you’re using the scope parameter (retired) while requesting a new access token and you want to contextualize the access token to the logged in user, the internalOauthToken you're using MUST NOT be expired. (The expiration time is denoted in the JWT.request.user.expiresIn value, which is in seconds.)
Here’s an example /requestToken request body structure to follow.
When you use this structure to receive a new access token, you also receive a new refreshToken. This newly provided refreshToken must be used in the subsequent call to get a new access token. The previous refreshToken provided in the JWT is now invalid because you’ve used it.