Create Campaign Ab test

Create Campaign Ab test

POST https://api.ocamba.com/v2/adex/campaign-ab-tests
Creates a new Campaign Ab test object

Note
We recommend using containers instead of tags, as tags are deprecated. If both parameters are sent, containers will take priority.

Rate limits:

  • Burst: 10/s
  • Steady: 150/m

Request schema

body

Response schemas

curl -X POST \
 "https://api.ocamba.com/v2/adex/campaign-ab-tests" \
  -H "Authorization: Bearer {TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
  "campaign_id": "1010797",
  "creative_id": "1321448",
  "name": "TestNo3",
  "stickiness": 1,
  "status": "inactive",
  "start_time": "2024-11-05 11:28:59",
  "end_time": "2024-12-04 00:00:00"
}'
const url = 'https://api.ocamba.com/v2/adex/campaign-ab-tests';
const options = {
  method: 'POST',
  headers: {
    Authorization: "Bearer {TOKEN}",
    'Content-Type': "application/json"
  },
  body: JSON.stringify(
    {
      "campaign_id": "1010797",
      "creative_id": "1321448",
      "name": "TestNo3",
      "stickiness": 1,
      "status": "inactive",
      "start_time": "2024-11-05 11:28:59",
      "end_time": "2024-12-04 00:00:00"
    }
  )
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
$ch = curl_init("https://api.ocamba.com/v2/adex/campaign-ab-tests");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer {TOKEN}",
  "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
  [
    "campaign_id" => "1010797",
    "creative_id" => "1321448",
    "name" => "TestNo3",
    "stickiness" => 1,
    "status" => "inactive",
    "start_time" => "2024-11-05 11:28:59",
    "end_time" => "2024-12-04 00:00:00"
  ]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Responses

201 Created

{
  "id": "10000",
  "company_id": "6197120",
  "campaign_id": "1011120",
  "creative_id": "1322610",
  "name": "First AB Test",
  "targeting": {
    "countries": {
      "items": "RS,DE,CA,US",
      "op": "eq"
    },
    "regions": {
      "items": "2661876,2565340",
      "op": "eq"
    },
    "os": {
      "items": [
        {
          "id": "12",
          "op": "in",
          "versions": [
            "10.0"
          ]
        }
      ]
    },
    "browsers": {
      "items": [
        {
          "id": "12",
          "op": "in",
          "versions": [
            "10.0"
          ]
        }
      ]
    },
    "subids": {
      "items": "ref_subid,subid_2",
      "op": "eq"
    },
    "categories": {
      "items": "IAB1,IAB2",
      "op": "eq"
    },
    "tags": {
      "items": "1441,1623",
      "op": "eq"
    },
    "containers": {
      "items": [
        "1020"
      ],
      "op": "in"
    },
    "ip": {
      "items": "123.523.123.4,123.523.123.4/12,2001:0db8:85a3:33a1:ff12:8a2e:0370:7334/23,2301:01b8:f5a3:43a1:afc2:8c2e:0370:7334",
      "op": "eq"
    },
    "zones": {
      "items": "1334141,1773238",
      "op": "eq"
    },
    "pages": {
      "items": "b92.net,google.com",
      "op": "eq"
    },
    "device_types": {
      "items": "mobile,console",
      "op": "eq"
    },
    "device_manufacturers": {
      "items": "14,6",
      "op": "eq"
    },
    "time": {
      "items": "* * 1 * *,* 12,13,14,19,23 * 4,5,6 * 6,0",
      "op": "in"
    },
    "keywords": {
      "items": "keyword01!\\|keyword02_%"
    },
    "languages": {
      "items": [
        [
          "sr",
          "en",
          "de"
        ]
      ],
      "op": "eq"
    }
  },
  "variation_count": 2,
  "variations": [
    {
      "id": "10000",
      "company_id": "6197120",
      "ab_test_id": "10000",
      "name": "My Variation",
      "create_time": "2021-10-29 15:40:10",
      "update_time": "2021-10-29 15:40:10"
    }
  ],
  "status": "active",
  "start_time": "2021-09-29 15:40:10",
  "end_time": "2021-10-29 15:40:10",
  "create_time": "2021-10-29 15:40:10",
  "update_time": "2021-10-29 15:40:10"
}

400 Bad Request

{
  "code": 400,
  "title": "Bad request.",
  "message": "The request is not valid.",
  "trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}

500 Internal Server Error

{
  "code": 500,
  "title": "Internal server error.",
  "trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}
Responses