Review this information when implemented a Resolve Token API for Tokenized Sending in Marketing Cloud Engagement.
This request supports HTTP basic authentication. Provide login credential when you set up an account, and use SSL connection to encrypt the usernames or passwords. You can also use OAuth2 with the client_credentials grant type.
JSON Response Body Format
| Name | Type | Required | Description | |
|---|---|---|---|---|
| resolvedTokens | None | array | Yes | Array of ResolvedToken objects |
| Each resolvedTokens object contains these properties: | ||||
| tokenRequestId | string | Yes | UUID generated per token during the request | |
| tokenValue | string | Yes | The resolved email address or phone number. You can also call this value email for backwards compatibility. | |
| attributes | string | Yes | Array of attributes associated with the resolved email address or phone number, presented in name and value pairs | |
| unresolvedTokens | None | array | Yes | Array of UnresolvedToken objects |
| Each unresolvedTokens array contains these properties: | ||||
| tokenRequestId | string | Yes | UUID generated per token during the request | |
| message | string | No | Error message indicating the cause of the unresolved token | |
HTTP Response Examples
The examples include response body with email addresses and attributes, response body with email addresses only, and response body with phone numbers.
Response Body with Email Addresses and Attributes
{
"resolvedTokens": [
{
"tokenRequestId":"abc123thn567",
"tokenValue": "user1@exacttarget.com",
"attributes": [
{
"name": "FirstName",
"value": "Alice"
},
{
"name": "LastName",
"value": "Smith"
}
]
},
{
"tokenRequestId":"abc098thn654",
"tokenValue ": "user2@gmail.com",
"attributes": [
{
"name": "FirstName",
"value": "John"
},
{
"name": "LastName",
"value": "Smith"
}
]
}
],
"unresolvedTokens": []
}
Response Body with Email Addresses
Note Not supported by MobileConnect.
{
"resolvedTokens": [
{
"tokenRequestId":"abc123thn567",
"tokenValue": "user2@gmail.com"
}
],
"unresolvedTokens": [
{
"tokenRequestId":"abc098thn654",
"message": "Invalid token; token does not exist."
}
]
}
Response Body with Phone Numbers
{
"resolvedTokens": [
{
"tokenRequestId":"abc123thn567",
"tokenValue": "13175551212"
}
],
"unresolvedTokens": [
{
"tokenRequestId":"abc098thn654",
"message": "Invalid token; token does not exist."
}
]
}
JSON Request Body Format
The JSON Request Body Format includes a valid JSON object (application/json content type) with these properties.
New Users must use Version 2 of the specification.
| Name | Type | Required | Description | |
|---|---|---|---|---|
| tokens | None | array | Yes | Array of token objects |
| Each tokens object contains an array of these objects: | ||||
| tokenRequestId | string | Yes | UUID generated per token | |
| token | string | Yes | Email address or mobile number token to resolve | |
| subscriberKey | string | Yes | Subscriber key or contact key value associated with the token to resolve | |
| sendKey | None | string | Yes |
|
Example with Email Addresses
{
"tokens": [
{
"tokenRequestId":"abc123thn567",
"token":"t1234@example.com",
"subscriberKey":"12345abcde67890fghij"
},
{
"tokenRequestId":"abc098thn654",
"token":"t5678@example.com",
"subscriberKey":"1111155555aAaAabBbBb"
}
],
"sendKey": "ExampleEmail_12345"
}
Example with Phone Number
Note MobileConnect does not support this functionality.
{
"tokens": [
{
"tokenRequestId":"abc123thn567",
"token":"012345678901234",
"subscriberKey":"12345abcde67890fghij"
},
{
"tokenRequestId":"abc098thn654",
"token":"012345678901235",
"subscriberKey":"1111155555aAaAabBbBb"
}
],
"sendKey": "ExampleEmail_12345"
}