UID2 API Documentation > v1 > Endpoints > GET /token/validate
Validate that an advertising token matches the specified email address or email address hash.
NOTE: This endpoint is intended primarily for testing and troubleshooting new integrations.
GET '{environment}/{version}/token/validate?token={tokenValue}&{queryParameter}={queryParameterValue}'
Path Parameter | Data Type | Attribute | Description |
---|---|---|---|
{environment} |
string | Required | Testing environment: https://integ.uidapi.com Production environment: https://prod.uidapi.com |
{version} |
string | Required | The current API version is v1 . |
- Only one of the two query parameters is required in a request:
email
oremail_hash
. - If both
email
andemail_hash
parameters are included in a request, only theemail
will return a response.
TIP: Consider using the
[email protected]
email address or its hash for testing.
Query Parameter | Data Type | Attribute | Description |
---|---|---|---|
token |
string | Required | The advertising token returned by the GET /token/generate response. |
email |
string | Conditionally Required | The email address for token validation. |
email_hash |
string | Conditionally Required | The URL-encoded, base64-encoded SHA256 hash of the normalized email address for token validation. |
A validation request for an email address:
curl -L -X GET 'https://integ.uidapi.com/v1/token/validate?token=AdvertisingTokenmZ4dZgeuXXl6DhoXqbRXQbHlHhA96leN94U1uavZVspwKXlfWETZ3b%2FbesPFFvJxNLLySg4QEYHUAiyUrNncgnm7ppu0mi6wU2CW6hssiuEkKfstbo9XWgRUbWNTM%2BewMzXXM8G9j8Q%3D&[email protected]' -H 'Authorization: Bearer YourTokenBV3tua4BXNw+HVUFpxLlGy8nWN6mtgMlIk='
A validation request for an email address hash:
curl -L -X GET 'https://integ.uidapi.com/v1/token/validate?token=AdvertisingTokenmZ4dZgeuXXl6DhoXqbRXQbHlHhA96leN94U1uavZVspwKXlfWETZ3b%2FbesPFFvJxNLLySg4QEYHUAiyUrNncgnm7ppu0mi6wU2CW6hssiuEkKfstbo9XWgRUbWNTM%2BewMzXXM8G9j8Q%3D&email_hash=eVvLS%2FVg%2BYZ6%2Bz3i0NOpSXYyQAfEXqCZ7BTpAjFUBUc%3D' -H 'Authorization: Bearer YourTokenBV3tua4BXNw+HVUFpxLlGy8nWN6mtgMlIk='
The response returns a boolean value that indicates the validation status of the specified advertising token.
{
"body": true,
"status": "success"
}
Property | Data Type | Description |
---|---|---|
body |
boolean | A value of true indicates that the email address or hash specified in the request is the same as the one used to generate the advertising token.A value of false indicates any of the following:- The request included an invalid advertising token. - The email address or hash specified in the request is either different from the one used to generate the advertising token or is not for the testing email [email protected] . |
For response status values, see Response Structure and Status Codes.