RTB API

Using merchenta.io for real-time bidding

HTML5 adtag campaign 

Our RTB API supports campaigns with HTML5 rich media ads. You can build the HTML5 creative using any number of tools (eg Google Web Designer or Adobe Creative Cloud) - and simply upload the creative to our fully-inclusive, globally replicated ad servers for campaign delivery. Neat!

This example combines HTML5 rich media ads with a contextual targeting strategy for illustrative purposes.

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"
            }
        }

Upload HTML script file 

/v3/creatives/upload/push
  • 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": "html-imu-2.html",
                "location": "https://cdn3.merchenta.com/static/assets/html-imu-2.html"
            }
        }

Create HTML5 adtag campaign 

/v3/campaigns/{ADVERTISER_CODE}-html-script

Creating a display campaign with HTML5 script:

  • transparent inventory
  • daily budget $100
  • all placement location - ATF/BTF/UNKNOWN
  • contextual categories
    • Music (110005)
    • Health & Fitness (117700)
  • Curl
  • Copy
    curl -i \ -X PUT \ -H 'Authorization: Bearer {YOUR_TOKEN_HERE}' \ -H 'Content-Type: application/json' \ -d '{ "creatives":[ { "code":"{ADVERTISER_CODE}-html-script-1", "creativeId":"html-imu-2.html", "dimensions":{ "width":300, "height":250 }, "clickthroughUrl":"http://merchenta.com", "type":"HTML-SCRIPT" }, { "code":"{ADVERTISER_CODE}-html-script-2", "creativeId":"merchenta-lb2.html", "dimensions":{ "width":728, "height":90 }, "clickthroughUrl":"http://merchenta.com", "type":"HTML-SCRIPT" } ], "inventorySettings":{ "inventoryType":"TRANSPARENT", "placementType":[ "ATF", "BTF", "UNKNOWN" ], "exchangeBlockList": ["GD", "BS"] }, "biddingSettings":{ "frequencyCap" : 12, "biddingStrategy":{ "strategy":"CPMCappedBiddingStrategy", "maxBid":2 }, "budget":{ "daily":100 }, "pacingType":"ACCELERATED" }, "targetingSettings" : { "contextualSettings" : { "iabCategories" : [110005, 117700] } } }' \ https://sandbox.rtbapi.io/v3/campaigns/{ADVERTISER_CODE}-html-script
  • Request
  • Headers
    Authorization: Bearer {YOUR_TOKEN_HERE}
    Content-Type: application/json
    Example body
    {
        "creatives":[
            {
                "code":"{ADVERTISER_CODE}-html-script-1",
                "creativeId":"html-imu-2.html",
                "dimensions":{
                    "width":300,
                    "height":250
                },
                "clickthroughUrl":"http://merchenta.com",
                "type":"HTML-SCRIPT"
            },
            {
                "code":"{ADVERTISER_CODE}-html-script-2",
                "creativeId":"merchenta-lb2.html",
                "dimensions":{
                    "width":728,
                    "height":90
                },
                "clickthroughUrl":"http://merchenta.com",
                "type":"HTML-SCRIPT"
            }
        ],
        "inventorySettings":{
            "inventoryType":"TRANSPARENT",
            "placementType":[
                "ATF",
                "BTF",
                "UNKNOWN"
            ],
            "exchangeBlockList": ["GD", "BS"]
        },
        "biddingSettings":{
            "frequencyCap" : 12,
            "biddingStrategy":{
                "strategy":"CPMCappedBiddingStrategy",
                "maxBid":2
            },
            "budget":{
                "daily":100
            },
            "pacingType":"ACCELERATED"
        },
        "targetingSettings" : {
            "contextualSettings" : {
                "iabCategories" : [110005, 117700]
            }
        }
    }
  • Response  200
  • Headers
    Content-Type: application/json
    Example body
    {
            "status": "success"
        }
Next page  Previous page