RTB API

Using merchenta.io for real-time bidding

Expandable ad campaign 

Expandable ads are special rich-media ads which expand/change dimensions when the consumer interacts with them (eg with a mouseover). merchenta.io supports expandable creative on display & mobile - this example shows how.

First of all, ensure you have a rich media ad which supports expansion - if you use a regular static ad type, when loaded the ad won’t expand!

Then, specify the ad unit dimensions and the direction of expansion (eg up, down, left, right). Several expansion directions are supported, just pick the one that your rich media ad supports.

This RTB API example also shows an alternative method of referencing an ad creative in a campaign. Instead of uploading the ad creative first, this example shows how to instruct the campaign to pull the ad creative from a 3rd party URL as the campaign is created.

Generate authentication token 

/v3/oauth/accessToken?username={username}&password={password}&advertiser={advertiser}
  • Parameters
  • username
    string (required) Example: username

    username

    password
    string (required) Example: password

    password

    advertiser
    string (required) Example: MERCHENTA

    advertiser code

  • Curl
  • Copy
    curl -i \ -X GET \ https://sandbox.rtbapi.io/v3/oauth/accessToken?username=username&password=password&advertiser=MERCHENTA
  • Response  200
  • Headers
    Content-Type: application/json
    Example body
    {
            "status": "success",
            "data": {
                "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZHYiOiJNRVJDSEVOVEEiLCJleHAiOiIyMDE0LTEwLTA3VDEwOjIwOjEyLjQ4OSIsInJsbSI6IkFETUlOIiwidXNyIjoidGVzdEBtZXJjaGVudGEuY29tIiwiaWF0IjoiMjAxNC0xMC0wN1QwOToyMDoxMi40NTAifQ.7fb8007c49abb7e083f4aca024512ef3c9d32ea1ab0502d2603f4c2c92545b80"
            }
        }

Create expandable ad campaign 

/v3/campaigns/{ADVERTISER_CODE}-expandable

Campaign with expandable creatives.

  • Curl
  • Copy
    curl -i \ -X PUT \ -H 'Authorization: Bearer {YOUR_TOKEN_HERE}' \ -H 'Content-Type: application/json' \ -d '{ "creatives":[ { "code":"{ADVERTISER_CODE}-expandable-1", "creativeId":"http://ad-ace.doubleclick.net/adi/N378.275220.MYBESTOPTION.IT4/B7688728.289;dcadv=2196503;sz=300x250", "dimensions":{ "width":300, "height":250, "expansion": { "width":600, "height":250, "direction":"RIGHT" } }, "clickthroughUrl":"http://merchenta.com", "type":"HTML-URL" } ], "inventorySettings":{ "inventoryType":"BLIND", "placementType":[ "ATF", "BTF", "UNKNOWN" ], "exchangeBlockList": ["GD", "BS"] }, "biddingSettings":{ "biddingStrategy":{ "strategy":"CPMCappedBiddingStrategy", "maxBid":2 }, "budget":{ "daily":10 }, "pacingType":"ACCELERATED" }, "timeSettings":{ "start" : "2014-01-01T12:00:00", "end" : "2014-01-05T12:00:00" } }' \ https://sandbox.rtbapi.io/v3/campaigns/{ADVERTISER_CODE}-expandable
  • Request
  • Headers
    Authorization: Bearer {YOUR_TOKEN_HERE}
    Content-Type: application/json
    Example body
    {
        "creatives":[
            {
                "code":"{ADVERTISER_CODE}-expandable-1",
                "creativeId":"http://ad-ace.doubleclick.net/adi/N378.275220.MYBESTOPTION.IT4/B7688728.289;dcadv=2196503;sz=300x250",
                "dimensions":{
                    "width":300,
                    "height":250,
                    "expansion": {
                        "width":600,
                        "height":250,
                        "direction":"RIGHT"
                    }
                },
                "clickthroughUrl":"http://merchenta.com",
                "type":"HTML-URL"
            }
        ],
        "inventorySettings":{
            "inventoryType":"BLIND",
            "placementType":[
                "ATF",
                "BTF",
                "UNKNOWN"
            ],
            "exchangeBlockList": ["GD", "BS"]
        },
        "biddingSettings":{
            "biddingStrategy":{
                "strategy":"CPMCappedBiddingStrategy",
                "maxBid":2
            },
            "budget":{
                "daily":10
            },
            "pacingType":"ACCELERATED"
        },
        "timeSettings":{
            "start" : "2014-01-01T12:00:00",
            "end" : "2014-01-05T12:00:00"
        }
    }
  • Response  200
  • Headers
    Content-Type: application/json
    Example body
    {
            "status": "success"
        }
Next page  Previous page