POST https://{base_url}/api/set_affiliate
This server-to-server API should be called by the platform when a player registers with any of the following affiliate tracking parameters in their query string: urm_aff_id, urm_aff_link_id, or urm_aff. At least one of these parameters must be provided.
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
| x-api-key | {your-api-key} | Yes |
Request Body
The request body should contain a JSON object with the player's profile identifier and any affiliate tracking parameters captured from the query string.
{
"app_id": "your_app_id",
"profile_id": "player_123",
"urm_aff_id": "abc",
"urm_aff_link_id": "xyz",
"urm_aff": "123"
}
Attributes
| Attribute | Type | Required | Description |
|---|---|---|---|
| app_id | String | Yes | Unique identifier for your application provided by your Account Manager |
| profile_id | String | Yes | Unique identifier for the player profile being associated with the affiliate |
| urm_aff_id | String | Conditional | Pass this value if it is present in the player's registration query string |
| urm_aff_link_id | String | Conditional | Pass this value if it is present in the player's registration query string |
| urm_aff | String | Conditional | Pass this value if it is present in the player's registration query string |
Note: At least one (or more) of
urm_aff_id, urm_aff_link_id, or urm_aff must be provided. Pass whichever values are available in the player's registration query string.
Validation Rules
| Field | Rule |
|---|---|
| app_id | Required. Cannot be null or an empty string |
| profile_id | Required. Cannot be null or an empty string |
| urm_aff_id, urm_aff_link_id, urm_aff | At least one must be provided. Cannot be an empty string if included |
Code Snippet
curl -X POST "https://{base_url}/api/set_affiliate" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "x-api-key: your_api_key" \
-d '{
"app_id": "your_app_id",
"profile_id": "player_123",
"urm_aff_id": "abc",
"urm_aff_link_id": "xyz",
"urm_aff": "abc"
}'
Response
Success Response (200 OK)
{
"message": "success",
"message_id": "uuid"
}
Forbidden (403 Forbidden)
{
"message": "Forbidden"
}
Note: A
403 Forbidden response indicates that the provided x-api-key is invalid or missing.
