RTB API

Using merchenta.io for real-time bidding

Campaign editing 

Once a campaign has been created, it may be edited – the settings may be changed and when saved again the campaign will restart in accordance with the new settings. Before changing the campaign’s settings, it must be ”locked” to prevent conflicting concurrent changes.

Lock 

/v3/campaigns/{campaignCode}/lock

Locks campaign. Lock automatically expires after 5 minutes from creation.

  • Parameters
  • campaignCode
    string (required) Example: MERCHENTA-test

    The campaign code.

  • Curl
  • Copy
    curl -i \ -X PUT \ -H 'Authorization: Bearer {YOUR_TOKEN_HERE}' \ https://sandbox.rtbapi.io/v3/campaigns/MERCHENTA-test/lock
  • Response  200
  • Headers
    Content-Type: application/json
    Example body
    {
        "status": "success"
    }

Update campaign 

Having locked the campaign, you should now retrieve the campaign (see Campaign lookup) and then resubmit the new settings using this endpoint.

/v3/campaigns/{campaignCode}

Overrides existing campaign. Campaign must be locked first.

  • Parameters
  • campaignCode
    string (required) Example: MERCHENTA-test

    The campaign code.

  • Curl
  • Copy
    curl -i \ -X PUT \ -H 'Authorization: Bearer {YOUR_TOKEN_HERE}' \ -H 'Content-Type: application/json' \ -d '{ "code":"MERCHENTA-test", "creatives":[ { "code":"MERCHENTA-test-1", "creativeId":"MERCHENTA-fa1a576f2b68bb5b6a8601ae1a669e32e99ab14a.png", "dimensions":{ "width":160, "height":600 }, "clickthroughUrl":"https://merchenta.io", "type":"IMAGE", "status":"PENDING" } ], "inventorySettings":{ "inventoryType":"TRANSPARENT", "placementType":[ "ATF", "BTF", "UNKNOWN" ] }, "biddingSettings":{ "biddingStrategy":{ "strategy":"CPMCappedBiddingStrategy", "maxBid":2.2 }, "budget":{ "daily":15 }, "pacingType":"ACCELERATED" } }' \ https://sandbox.rtbapi.io/v3/campaigns/MERCHENTA-test
  • Request
  • Headers
    Authorization: Bearer {YOUR_TOKEN_HERE}
    Content-Type: application/json
    Example body
    {
        "code":"MERCHENTA-test",
        "creatives":[
            {
                "code":"MERCHENTA-test-1",
                "creativeId":"MERCHENTA-fa1a576f2b68bb5b6a8601ae1a669e32e99ab14a.png",
                "dimensions":{
                    "width":160,
                    "height":600
                },
                "clickthroughUrl":"https://merchenta.io",
                "type":"IMAGE",
                "status":"PENDING"
            }
        ],
        "inventorySettings":{
            "inventoryType":"TRANSPARENT",
            "placementType":[
                "ATF",
                "BTF",
                "UNKNOWN"
            ]
        },
        "biddingSettings":{
            "biddingStrategy":{
                "strategy":"CPMCappedBiddingStrategy",
                "maxBid":2.2
            },
            "budget":{
                "daily":15
            },
            "pacingType":"ACCELERATED"
        }
    }
  • Response  200
  • Headers
    Content-Type: application/json
    Example body
    {
            "status": "success"
        }

Unlock 

/v3/campaigns/{campaignCode}/lock

Unlocks a previously locked campaign.

  • Parameters
  • campaignCode
    string (required) Example: MERCHENTA-test

    The campaign code.

  • Curl
  • Copy
    curl -i \ -X DELETE \ -H 'Authorization: Bearer {YOUR_TOKEN_HERE}' \ https://sandbox.rtbapi.io/v3/campaigns/MERCHENTA-test/lock
  • Response  200
  • Headers
    Content-Type: application/json
    Example body
    {
            "status": "success"
        }
Next page  Previous page