Create Zone

Create Zone

POST https://api.ocamba.com/v2/adex/zones
Creates a new Zone object

Info
Widgets are only available for zones of type widget. User_cache is only available for zones of type push.
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/zones" \
  -H "Authorization: Bearer {TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "example_zone_name",
  "description": "This is my first zone.",
  "status": "active",
  "type": "rtb",
  "pricing_model": "cpc",
  "campaign_priority": "compete",
  "account_id": "10073337",
  "search_algo_expl_rate": 10,
  "external_expl_rate": 15,
  "response_timeout": 250,
  "revenue_share": 30,
  "bid_floor": 32.5,
  "subid_hash": {
    "key": "my_key",
    "enabled": 1
  },
  "user_cache": 1,
  "widgets": [
    "788"
  ],
  "targeting": {
    "countries": {
      "items": [
        "RS"
      ],
      "lists": [
        "1838"
      ],
      "op": "in"
    }
  },
  "filters": {
    "policy": "block",
    "ip_match": 1,
    "max_click_delay": 86400000,
    "min_click_delay": "1500"
  }
}'
const url = 'https://api.ocamba.com/v2/adex/zones';
const options = {
  method: 'POST',
  headers: {
    Authorization: "Bearer {TOKEN}",
    'Content-Type': "application/json"
  },
  body: JSON.stringify(
    {
      "name": "example_zone_name",
      "description": "This is my first zone.",
      "status": "active",
      "type": "rtb",
      "pricing_model": "cpc",
      "campaign_priority": "compete",
      "account_id": "10073337",
      "search_algo_expl_rate": 10,
      "external_expl_rate": 15,
      "response_timeout": 250,
      "revenue_share": 30,
      "bid_floor": 32.5,
      "subid_hash": {
        "key": "my_key",
        "enabled": 1
      },
      "user_cache": 1,
      "widgets": [
        "788"
      ],
      "targeting": {
        "countries": {
          "items": [
            "RS"
          ],
          "lists": [
            "1838"
          ],
          "op": "in"
        }
      },
      "filters": {
        "policy": "block",
        "ip_match": 1,
        "max_click_delay": 86400000,
        "min_click_delay": "1500"
      }
    }
  )
};

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/zones");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer {TOKEN}",
  "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
  [
    "name" => "example_zone_name",
    "description" => "This is my first zone.",
    "status" => "active",
    "type" => "rtb",
    "pricing_model" => "cpc",
    "campaign_priority" => "compete",
    "account_id" => "10073337",
    "search_algo_expl_rate" => 10,
    "external_expl_rate" => 15,
    "response_timeout" => 250,
    "revenue_share" => 30,
    "bid_floor" => 32.5,
    "subid_hash" => [
      "key" => "my_key",
      "enabled" => 1
    ],
    "user_cache" => 1,
    "widgets" => [
      "788"
    ],
    "targeting" => [
      "countries" => [
        "items" => [
          "RS"
        ],
        "lists" => [
          "1838"
        ],
        "op" => "in"
      ]
    ],
    "filters" => [
      "policy" => "block",
      "ip_match" => 1,
      "max_click_delay" => 86400000,
      "min_click_delay" => "1500"
    ]
  ]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Responses

201 Created

{
  "id": "3002792",
  "track_id": "00000000000971895032",
  "company_id": "7196310",
  "account_id": "10073337",
  "creator_id": "1000222",
  "name": "example_zone_name",
  "description": "This is my first zone.",
  "status": "active",
  "type": "rtb",
  "pricing_model": "cpc",
  "campaign_priority": "compete",
  "campaign_search_algo": "round-robin",
  "search_algo_expl_rate": 10,
  "external_expl_rate": 15,
  "response_timeout": 250,
  "revenue_share": 30,
  "bid_floor": 32.5,
  "create_time": "2021-10-29 12:47:00",
  "update_time": "2021-10-30 14:27:26"
}

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