Trading Desk Stats API allows inquiring statistics by entities in general (advertisers, campaigns, etc.) or by metrics in particular (impressions, clicks, unique users, etc.).

Getting a Token

To begin with, you need to get an access token. Using Postman or similar software, send a POST request by URL https://api.stacksandbox.com/api/token?userName=user&password=pass

Value Description
userName Your account login (email)
password Password to your account
In response, you’ll receive a JSON with an access_token field.
Expand an example of JSON with an access token
{“access_token”=”WAoAc8VaBdBbNeaqZd_DG7AI243l_e5WNXxTN56RNNfyvRmspx”}

The field’s value is your access token. Specify it in the request header every time you inquire statistics the following way:

Authorization: Bearer your_token

where you replace your_token with your access token. For example:


Next, you get entity IDs.

Requesting Entity IDs

You need an entity ID to request statistics.

Admixer Entities


Entity Description
Advertiser Defines a real advertiser in the Admixer system
Campaign Corresponds to one ad campaign
Profile Contains ad delivery settings, e.g. the budget, inventory, targeting, and bid details
Ad Item Contains main information about the creative, allows to set creative rotation priority and event tracking

Retrieving IDs

To retrieve entity IDs, send a GET request by a corresponding URL.

Entity URL
Advertiser https://api.stacksandbox.com/api/advertiser/list
Campaign https://api.stacksandbox.com/api/campaign/list
Profile https://api.stacksandbox.com/api/profile/list
Ad Item https://api.stacksandbox.com/api/ad-item/list
Expand an example with the response
{6831,6832,6833,6834}

Now that you have entity IDs, you can request information about them and their statistics.

You can retrieve information about a particular entity (name in the system, state, ad settings, etc.). Send GET request by a corresponding URL.

Entity URL
Advertiser https://api.stacksandbox.com/api/advertiser/advertiser_id
Campaign https://api.stacksandbox.com/api/campaign/campaign_id
Profile https://api.stacksandbox.com/api/profile/profile_id
Ad Item https://api.stacksandbox.com/api/ad-item/ad-item_id

Replace advertiser_idcampaign_idprofile_idad Item_id with an advertiser ID, campaign ID, profile ID, or Ad Item ID respectively in your request URL.

Expand an example of the response for the entity request
{
  "Id": 6831,
  "Name": "advertiser",
  "DisplayName": null,
  "State": "Active"
}
Updated on September 25, 2023