RTB API

Using merchenta.io for real-time bidding

Creative upload 

Before a campaign can be created, the ad creative must be uploaded to Merchenta via the API. From there, Merchenta will replicate the creative across our content delivery network (CDN) to ensure speedy ad serving to your customers wherever in the world they may be.

The creative can be in one of a range of formats complying with merchenta.io creative guidelines. The following are supported JPEG, GIF, PNG, SWF (Flash ActionScript for Flash Player v8 or higher).

Each creative asset is identifiable by a unique asset identifier. It’s this identifier which is used when scheduling a campaign.

There are two alternative ways to put creative into Merchenta’s CDN:

  • file upload via multipart/form-data POST request
  • resource pull from publicly available URL

The id returned on the response is then used in the campaign endpoint. Once uploaded, the ad creative can be viewed on the CDN by reference to the location value.

The same procedure can be repeated for uploading an alternate creative file, for example to associate a static image ad with a Flash SWF ad in cases where the display device doesn’t support Flash.

Note

CDN replication can take up to 60 seconds to complete across European edge servers – and up to a few minutes across USA/Asia.

Push 

/v3/creatives/upload/push

Uploads creative file to CDN.

  • Curl
  • Copy
    curl -i \ -X POST \ -H 'Authorization: Bearer {YOUR_TOKEN_HERE}' \ -F creative=@[YOUR_FILENAME_HERE] \ https://sandbox.rtbapi.io/v3/creatives/upload/push
  • Request
  • Headers
    Authorization: Bearer {YOUR_TOKEN_HERE}
    Content-Type: multipart/form-data
    Content-Disposition: form-data; name="creative"; filename="[YOUR_FILENAME_HERE]"
  • Response  200
  • Headers
    Content-Type: application/json
    Example body
    {
            "status": "success",
            "data": {
                "id": "MERCHENTA-b021a5e27751d90f56803375d4329d9a33e72bad.jpg",
                "location": "https://cdn3.merchenta.com/static/assets/MERCHENTA-b021a5e27751d90f56803375d4329d9a33e72bad.jpg"
            }
        }

Pull 

/v3/creatives/upload/pull

Uploads creative file to CDN by pulling it from remote, publicly available server.

  • Curl
  • Copy
    curl -i \ -X POST \ -H 'Authorization: Bearer {YOUR_TOKEN_HERE}' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -d 'url=http%3A%2F%2Florempixel.com%2F400%2F200%2Fbusiness%2F' \ https://sandbox.rtbapi.io/v3/creatives/upload/pull
  • Request
  • Headers
    Authorization: Bearer {YOUR_TOKEN_HERE}
    Content-Type: application/x-www-form-urlencoded
    Example body
    url=http%3A%2F%2Florempixel.com%2F400%2F200%2Fbusiness%2F
  • Response  200
  • Headers
    Content-Type: application/json
    Example body
    {
            "status": "success",
            "data": {
                "id": "MERCHENTA-b021a5e27751d90f56803375d4329d9a33e72bad.jpg",
                "location": "https://cdn3.merchenta.com/static/assets/MERCHENTA-b021a5e27751d90f56803375d4329d9a33e72bad.jpg"
            }
        }
Next page  Previous page