Skip to main content

Bidding

Bidding operates as a distributed transaction. The sequential flow is as follows:

  1. you upload a bid
  2. we store it in justtrack -> status: pending
  3. we try to apply it on partner side
    a. if successful -> status: success
    b. if error: we rollback the change by fetching the current value from partner -> status: rollback-error
    b.1. rollback succeeded -> status: rollback-error
    b.2. rollback-failed -> status: error
  4. We update the bid based on the returning status. In the case of newly creation bids, this includes deleting them to ensure a consistent state between justtrack and the partner.

This process can take up to 30 minutes for rollbacks. Only then you will see a stable status.

info

We gather bids and apply them on the partner side in batches. This increases throughput and overall speed in which changes are applied. As a downside, if one bid in one batch fails, mostly the entire batch is rejected and enters the rollback process.

Fetch current bids with status

This API provides with the bids within justtrack. In addition, it exposes the status of the latest operation associated with the bid.

curl -X POST -H 'X-API-KEY: `{api key}`' 'https://api.justtrack.io/management/v0/bids' \
-d '{"campaignId": 1, "country": "DE", "sourceId": "ffe6f603"}'

Request

{
"page": {
"offset": integer,
"limit": integer,
},
"filter": {
"networkId": integer,
"campaignId": integer,
"adSetId": integer,
"country": string,
"sourceId": string
}
}
NameTypeDescription
page.offsetintNumber of bids to skip for this filter
page.limitintMaximum number of bids to return
filter.networkIdint

justtrack internal network ID
Optional: set to null when not needed

filter.campaignIdint

justtrack internal campaign ID
Optional: set to null when not needed

filter.adSetIdint

justtrack internal ad set ID
Optional: set to null when not needed

filter.countrystring

ISO 3166-1 alpha-2 code of your country, e.g. "DE"
Optional: set to null when not needed

filter.sourceIdstring

Identifier provided by ad network to target specific source app.
Optional: set to null when not needed

The following filter combinations are eligible:

  • networkId
  • campaignId
  • campaignId + country
  • campaignId + country + sourceId
  • adSetId
  • adSetId + country
  • adSetId + country + sourceId

Response

Success: HTTP 200

[{
"networkId": integer,
"campaignId": integer,
"adSetId": integer,
"country": string,
"sourceId": string,
"status": string,
"value": float
}]
NameTypeDescription
networkIdintjusttrack internal network ID
campaignIdintjusttrack internal campaign ID
adSetIdint / nulljusttrack internal ad set ID
countrystring / nullISO 3166-1 alpha-2 code of your country, e.g. "DE"
sourceIdstring / nullIdentifier provided by ad network to target specific source app.
statusstringCurrent status of the latest bid operation
valuefloatCurrent value of the bid

Invalid input: HTTP 400

{
"error": string
}
NameTypeDescription
errorstringdescription of the error

Upload bids

With this API you can upload a batch of bids, similar to the CSV upload. The same hierarchy, rules, and limitations apply.

curl -X POST -H 'X-API-KEY: `{api key}`' 'https://api.justtrack.io/management/v0/bids/upload' \
-d '[`{"campaign": {"id": 1234}`, "country": "DE", "optimalBidUsd": 0.01, "delete": false}]'

Request

[
{
"adSetId": integer,
"campaign": {
"id": integer
},
"country": string,
"sourceId": string,
"optimalBidUsd": float,
"delete": boolean
}
]
NameTypeDescription
adSetIdint

justtrack internal ad set id
Optional: set to null when not needed

campaign.idintjusttrack internal campaign ID
countrystringISO 3166-1 alpha-2 code of your country, e.g. "DE"
sourceIdstring

Identifier provided by ad network to target specific source app.
Optional: set to null when not needed

optimalBidUsdfloatThe target bid value, in USD
deleteboolean

Whether this operation is delete or not
Optional: default is false

Response

Success: HTTP 204

{}

Invalid request: HTTP 400

{
"error": string
"bidsValidation": [
{
"adSetId": integer
"campaign": {
"id": integer,
"name": string
},
"country": {
"id": integer,
"name": string,
"iso2": string
},
"delta": {
"changePercentage": float,
"newValue": float,
"oldValue": float
},
"network": {
"id": integer,
"name": string
},
"sourceId": string,
"status": string,
"message": string
}
]
}

For each bid failing validation an entry to bidsValidation is added, detailing its dimensions, the value change and the reason why it was rejected. Possible reasons include:

  • ad set bidding isn't enabled for this network
  • ad set not found
  • bidding isn't enabled for this network
  • campaign bidding isn't enabled for this network
  • countries of the campaign doesn't contain the bid's specified country
  • campaign has wrong optimization type for bidding
  • missing credentials
  • missing campaign attributes
  • missing client network vendor attributes
  • missing network vendor attributes
  • source ID bidding isn't enabled
  • source ID bid requires ad set to be set
  • can not delete campaign bid
  • can not delete non-existent bid
  • bid value is below minimum
  • given decimal precision isn't supported for this network

Error: HTTP 500

{
"err": string
}