RTB API

Using merchenta.io for real-time bidding

Campaign status 

A campaign’s status is managed via its Creative status(es). A campaign will be showing ads only for ACTIVE Creatives, e.g. if you want to pause the whole Campaign you can change all its Creative statuses to INACTIVE (which is possible to do with single API call or multiple per Creative API calls).

Get status of all campaign creatives 

/v3/campaigns/{campaignCode}/status

Get status of all campaign creatives.

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

    The campaign code.

  • Curl
  • Copy
    curl -i \ -X GET \ -H 'Authorization: Bearer {YOUR_TOKEN_HERE}' \ https://sandbox.rtbapi.io/v3/campaigns/MERCHENTA-test/status
  • Response  200
  • Headers
    Content-Type: application/json
    Example body
    {
            "status": "success",
            "data": {
                "status": [
                    {
                        "creativeID": "MERCHENTA-Merchenta-Leader-v2-A.78595.jpg",
                        "creativeCode": "MERCHENTA-test-1",
                        "approvalStatus": "PENDING",
                        "approvalMessage": "Creative is under review. Please check again later.",
                        "latestUpdate": "2014-10-06T16:13:32.000"
                    },
                    {
                        "creativeID": "MERCHENTA-Merchenta-IMU-v2-A.47831.jpg",
                        "creativeCode": "MERCHENTA-test-2",
                        "approvalStatus": "PENDING",
                        "approvalMessage": "Creative is under review. Please check again later.",
                        "latestUpdate": "2014-10-06T16:13:32.000"
                    }
                ]
            }
        }

Get single creative status by creative code 

/v3/creatives/{creativeCode}/status

Retrieves campaign creative status by creative code.

  • Parameters
  • creativeCode
    string (required) Example: MERCHENTA-test-1

    The campaign creative code.

  • Curl
  • Copy
    curl -i \ -X GET \ -H 'Authorization: Bearer {YOUR_TOKEN_HERE}' \ https://sandbox.rtbapi.io/v3/creatives/MERCHENTA-test-1/status
  • Response  200
  • Headers
    Content-Type: application/json
    Example body
    {
            "status": "success",
            "data": {
                "status": {
                    "creativeID": "MERCHENTA-Merchenta-Leader-v2-A.78595.jpg",
                    "creativeCode": "MERCHENTA-test-1",
                    "approvalStatus": "PENDING",
                    "approvalMessage": "Creative is under review. Please check again later.",
                    "latestUpdate": "2014-10-06T16:13:32.000"
                }
            }
        }
  • Response  404

Change campaign's creative status 

/v3/creatives/{creativeCode}/status

Changes creative status.

Note: To change the status of a campaign’s creative, the campaign must first be locked, see Campaign editing.

  • Parameters
  • creativeCode
    string (required) Example: MERCHENTA-test-1

    The campaign creative code.

  • Curl
  • Copy
    curl -i \ -X POST \ -H 'Authorization: Bearer {YOUR_TOKEN_HERE}' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -d 'status=ACTIVE' \ https://sandbox.rtbapi.io/v3/creatives/MERCHENTA-test-1/status
  • Request
  • Headers
    Authorization: Bearer {YOUR_TOKEN_HERE}
    Content-Type: application/x-www-form-urlencoded
    Example body
    status=ACTIVE
  • Response  200
  • Headers
    Content-Type: application/json
    Example body
    {
            "status": "success"
        }
  • Response  400
  • Headers
    Content-Type: application/json
    Example body
    {
            "status": "fail",
            "data": {
                "errors": [
                    {
                        "code": "E10059",
                        "description": "it is not possible to change status from PENDING to ACTIVE for creative MERCHENTA-test-1"
                    }
                ]
            }
        }

Change all campaign's creatives statuses 

/v3/campaigns/{campaignCode}/status

Changes the status of all creatives for a campaign, if the requested status transition is allowed.

In case the status transition is allowed only for some of campaign’s creatives this method returns HTTP status code 200 with warnings object containing information on the creatives that were not changed.

In case none of creative’s status could be changed HTTP 400 status code is returned.

Note: To change the status of a campaign’s creatives, the campaign must first be locked, see Campaign editing.

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

    The campaign code.

  • Curl
  • Copy
    curl -i \ -X POST \ -H 'Authorization: Bearer {YOUR_TOKEN_HERE}' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -d 'status=ACTIVE' \ https://sandbox.rtbapi.io/v3/campaigns/MERCHENTA-test/status
  • Request
  • Headers
    Authorization: Bearer {YOUR_TOKEN_HERE}
    Content-Type: application/x-www-form-urlencoded
    Example body
    status=ACTIVE
  • Response  200
  • Headers
    Content-Type: application/json
    Example body
    {
        "status": "success"
    }
  • Response  200
  • Headers
    Content-Type: application/json
    Example body
    {
        "status": "success",
        "data": {
            "warnings": [
                {
                    "code": "E10059",
                    "description": "it is not possible to change status from PENDING to ACTIVE for creative MERCHENTA-test-2"
                }
            ]
        }
    }
  • Response  400
  • Headers
    Content-Type: application/json
    Example body
    {
        "status": "fail",
        "data": {
            "errors": [
                {
                    "code": "E10059",
                    "description": "it is not possible to change status from PENDING to ACTIVE for creative MERCHENTA-test-1"
                },
                {
                    "code": "E10059",
                    "description": "it is not possible to change status from PENDING to ACTIVE for creative MERCHENTA-test-2"
                }
            ]
        }
    }
Next page  Previous page