Create Zone

Create Zone

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

Request schema

body
curl -X POST \
 "https://api.ocamba.com/v2/adex/zones" \
  -H "Authorization: Bearer {TOKEN}" \
  -H "Content-Type: application/json" \
  -d '"{\n    \"name\": \"example_zone_name\",\n    \"description\": \"This is my first zone.\",\n    \"status\": \"active\",\n    \"type\": \"rtb\",\n    \"pricing_model\": \"cpc\",\n    \"campaign_priority\" : \"compete\",\n    \"account_id\": \"10073337\",\n    \"search_algo_expl_rate\" : 10,\n    \"external_expl_rate\": 15,\n    \"response_timeout\": 250,\n    \"revenue_share\" : 30,\n    \"bid_floor\": 32.5,\n    \"subid_hash\": {\n        \"key\": \"my_key\",\n        \"enabled\": 1\n    }\n    \"user_cache\": 1,\n    \"widgets\": [\n      \"788\"\n    ],\n    \"targeting\": {\n      \"countries\": {\n        \"items\": [\n          \"RS\"\n        ],\n        \"lists\": [\n          \"1838\"\n        ],\n        \"op\": \"in\"\n      },\n      \"regions\": {\n        \"items\": [\n          \"2661876\"\n        ],\n        \"lists\": [\n          \"2934\"\n        ],\n        \"op\": \"in\"\n      },\n      \"subids\": {\n        \"items\": [\n          \"fut_t10_18-24-MULTI_GG\"\n        ],\n        \"lists\": [\n          \"1835\"\n        ],\n        \"op\": \"in\"\n      },\n      \"ip\": {\n        \"items\": [\n          \"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\"\n        ],\n        \"lists\": [\n          \"2691\"\n        ],\n        \"op\": \"in\"\n      },\n      \"pages\": {\n        \"items\": [\n          \"ocamba.com\"\n        ],\n        \"lists\": [\n          \"2725\"\n        ],\n        \"op\": \"in\"\n      },\n      \"categories\": {\n        \"items\": [\n          \"IAB1\", \"IAB1-1\", \"IAB2\"\n        ],\n        \"lists\": [\n          \"2733\"\n        ],\n        \"op\": \"in\"\n      },\n      \"containers\": {\n        \"items\": [\n          \"1303\"\n        ],\n        \"op\": \"in\"\n      },\n      \"device_types\": {\n        \"items\": [\n          \"console\"\n        ],\n        \"op\": \"in\"\n      },\n      \"device_manufacturers\": {\n        \"items\": [\n          \"13\"\n        ],\n        \"op\": \"in\"\n      },\n      \"os\": {\n        \"items\": [\n          {\n            \"id\": \"12\",\n            \"op\": \"in\",\n            \"versions\": [\n              \"10.0\"\n            ]\n          }\n        ]\n      },\n      \"browsers\": {\n        \"items\": [\n          {\n            \"id\": \"10\",\n            \"op\": \"in\",\n            \"versions\": [\n              \"10.0\"\n            ]\n          }\n        ]\n      },\n      \"connections\": {\n        \"items\": [\n          \"1\"\n        ],\n        \"op\": \"nin\"\n      },\n      \"time\": {\n        \"items\": [\n          \"[0,15,30,45 12,13,14 * 6 1]\"\n        ],\n        \"op\": \"in\"\n      },\n      \"device_tracking\": 1,\n      \"has_user_data\": 1\n    },\n    \"filters\": {\n      \"policy\": \"block\",\n      \"ip_match\": 1,\n      \"max_click_delay\": 86400000,\n      \"min_click_delay\": \"1500\"\n    },\n    \"create_time\": \"2021-10-29 12:47:00\",\n    \"update_time\": \"2021-10-30 14:27:26\"\n}"'
const url = 'https://api.ocamba.com/v2/adex/zones';
const options = {
  method: 'POST',
  headers: {
    Authorization: "Bearer {TOKEN}",
    'Content-Type': "application/json"
  },
  body: JSON.stringify(
    "{\n    \"name\": \"example_zone_name\",\n    \"description\": \"This is my first zone.\",\n    \"status\": \"active\",\n    \"type\": \"rtb\",\n    \"pricing_model\": \"cpc\",\n    \"campaign_priority\" : \"compete\",\n    \"account_id\": \"10073337\",\n    \"search_algo_expl_rate\" : 10,\n    \"external_expl_rate\": 15,\n    \"response_timeout\": 250,\n    \"revenue_share\" : 30,\n    \"bid_floor\": 32.5,\n    \"subid_hash\": {\n        \"key\": \"my_key\",\n        \"enabled\": 1\n    }\n    \"user_cache\": 1,\n    \"widgets\": [\n      \"788\"\n    ],\n    \"targeting\": {\n      \"countries\": {\n        \"items\": [\n          \"RS\"\n        ],\n        \"lists\": [\n          \"1838\"\n        ],\n        \"op\": \"in\"\n      },\n      \"regions\": {\n        \"items\": [\n          \"2661876\"\n        ],\n        \"lists\": [\n          \"2934\"\n        ],\n        \"op\": \"in\"\n      },\n      \"subids\": {\n        \"items\": [\n          \"fut_t10_18-24-MULTI_GG\"\n        ],\n        \"lists\": [\n          \"1835\"\n        ],\n        \"op\": \"in\"\n      },\n      \"ip\": {\n        \"items\": [\n          \"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\"\n        ],\n        \"lists\": [\n          \"2691\"\n        ],\n        \"op\": \"in\"\n      },\n      \"pages\": {\n        \"items\": [\n          \"ocamba.com\"\n        ],\n        \"lists\": [\n          \"2725\"\n        ],\n        \"op\": \"in\"\n      },\n      \"categories\": {\n        \"items\": [\n          \"IAB1\", \"IAB1-1\", \"IAB2\"\n        ],\n        \"lists\": [\n          \"2733\"\n        ],\n        \"op\": \"in\"\n      },\n      \"containers\": {\n        \"items\": [\n          \"1303\"\n        ],\n        \"op\": \"in\"\n      },\n      \"device_types\": {\n        \"items\": [\n          \"console\"\n        ],\n        \"op\": \"in\"\n      },\n      \"device_manufacturers\": {\n        \"items\": [\n          \"13\"\n        ],\n        \"op\": \"in\"\n      },\n      \"os\": {\n        \"items\": [\n          {\n            \"id\": \"12\",\n            \"op\": \"in\",\n            \"versions\": [\n              \"10.0\"\n            ]\n          }\n        ]\n      },\n      \"browsers\": {\n        \"items\": [\n          {\n            \"id\": \"10\",\n            \"op\": \"in\",\n            \"versions\": [\n              \"10.0\"\n            ]\n          }\n        ]\n      },\n      \"connections\": {\n        \"items\": [\n          \"1\"\n        ],\n        \"op\": \"nin\"\n      },\n      \"time\": {\n        \"items\": [\n          \"[0,15,30,45 12,13,14 * 6 1]\"\n        ],\n        \"op\": \"in\"\n      },\n      \"device_tracking\": 1,\n      \"has_user_data\": 1\n    },\n    \"filters\": {\n      \"policy\": \"block\",\n      \"ip_match\": 1,\n      \"max_click_delay\": 86400000,\n      \"min_click_delay\": \"1500\"\n    },\n    \"create_time\": \"2021-10-29 12:47:00\",\n    \"update_time\": \"2021-10-30 14:27:26\"\n}"
  )
};

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(
  "[\n    \"name\" => \"example_zone_name\",\n    \"description\" => \"This is my first zone.\",\n    \"status\" => \"active\",\n    \"type\" => \"rtb\",\n    \"pricing_model\" => \"cpc\",\n    \"campaign_priority\" => \"compete\",\n    \"account_id\" => \"10073337\",\n    \"search_algo_expl_rate\" => 10,\n    \"external_expl_rate\" => 15,\n    \"response_timeout\" => 250,\n    \"revenue_share\" => 30,\n    \"bid_floor\" => 32.5,\n    \"subid_hash\" => [\n        \"key\" => \"my_key\",\n        \"enabled\" => 1\n    ]\n    \"user_cache\" => 1,\n    \"widgets\" => [\n      \"788\"\n    ],\n    \"targeting\" => [\n      \"countries\" => [\n        \"items\" => [\n          \"RS\"\n        ],\n        \"lists\" => [\n          \"1838\"\n        ],\n        \"op\" => \"in\"\n      ],\n      \"regions\" => [\n        \"items\" => [\n          \"2661876\"\n        ],\n        \"lists\" => [\n          \"2934\"\n        ],\n        \"op\" => \"in\"\n      ],\n      \"subids\" => [\n        \"items\" => [\n          \"fut_t10_18-24-MULTI_GG\"\n        ],\n        \"lists\" => [\n          \"1835\"\n        ],\n        \"op\" => \"in\"\n      ],\n      \"ip\" => [\n        \"items\" => [\n          \"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\"\n        ],\n        \"lists\" => [\n          \"2691\"\n        ],\n        \"op\" => \"in\"\n      ],\n      \"pages\" => [\n        \"items\" => [\n          \"ocamba.com\"\n        ],\n        \"lists\" => [\n          \"2725\"\n        ],\n        \"op\" => \"in\"\n      ],\n      \"categories\" => [\n        \"items\" => [\n          \"IAB1\", \"IAB1-1\", \"IAB2\"\n        ],\n        \"lists\" => [\n          \"2733\"\n        ],\n        \"op\" => \"in\"\n      ],\n      \"containers\" => [\n        \"items\" => [\n          \"1303\"\n        ],\n        \"op\" => \"in\"\n      ],\n      \"device_types\" => [\n        \"items\" => [\n          \"console\"\n        ],\n        \"op\" => \"in\"\n      ],\n      \"device_manufacturers\" => [\n        \"items\" => [\n          \"13\"\n        ],\n        \"op\" => \"in\"\n      ],\n      \"os\" => [\n        \"items\" => [\n          [\n            \"id\" => \"12\",\n            \"op\" => \"in\",\n            \"versions\" => [\n              \"10.0\"\n            ]\n          ]\n        ]\n      ],\n      \"browsers\" => [\n        \"items\" => [\n          [\n            \"id\" => \"10\",\n            \"op\" => \"in\",\n            \"versions\" => [\n              \"10.0\"\n            ]\n          ]\n        ]\n      ],\n      \"connections\" => [\n        \"items\" => [\n          \"1\"\n        ],\n        \"op\" => \"nin\"\n      ],\n      \"time\" => [\n        \"items\" => [\n          \"[0,15,30,45 12,13,14 * 6 1]\"\n        ],\n        \"op\" => \"in\"\n      ],\n      \"device_tracking\" => 1,\n      \"has_user_data\" => 1\n    ],\n    \"filters\" => [\n      \"policy\" => \"block\",\n      \"ip_match\" => 1,\n      \"max_click_delay\" => 86400000,\n      \"min_click_delay\" => \"1500\"\n    ],\n    \"create_time\" => \"2021-10-29 12:47:00\",\n    \"update_time\" => \"2021-10-30 14:27:26\"\n]"
));
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,
  "subid_hash": { 
      "key": "my_key",
      "enabled": 1
  }
  "user_cache": 1,
  "widgets": [
    "788"
  ],
  "targeting": {
    "countries": {
      "items": [
        "RS"
      ],
      "lists": [
        "1838"
      ],
      "op": "in"
    },
    "regions": {
      "items": [
        "2661876"
      ],
      "lists": [
        "2934"
      ],
      "op": "in"
    },
    "subids": {
      "items": [
        "fut_t10_18-24-MULTI_GG"
      ],
      "lists": [
        "1835"
      ],
      "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"
      ],
      "lists": [
        "2691"
      ],
      "op": "in"
    },
    "pages": {
      "items": [
        "ocamba.com"
      ],
      "lists": [
        "2725"
      ],
      "op": "in"
    },
    "categories": {
      "items": [
        "IAB1", "IAB1-1", "IAB2"
      ],
      "lists": [
        "2733"
      ],
      "op": "in"
    },
    "containers": {
      "items": [
        "1303"
      ],
      "op": "in"
    },
    "device_types": {
      "items": [
        "console"
      ],
      "op": "in"
    },
    "device_manufacturers": {
      "items": [
        "13"
      ],
      "op": "in"
    },
    "os": {
      "items": [
        {
          "id": "12",
          "op": "in",
          "versions": [
            "10.0"
          ]
        }
      ]
    },
    "browsers": {
      "items": [
        {
          "id": "10",
          "op": "in",
          "versions": [
            "10.0"
          ]
        }
      ]
    },
    "connections": {
      "items": [
        "1"
      ],
      "op": "nin"
    },
    "time": {
      "items": [
        "[0,15,30,45 12,13,14 * 6 1]"
      ],
      "op": "in"
    },
    "device_tracking": 1,
    "has_user_data": 1
  },
  "filters": {
    "policy": "block",
    "ip_match": 1,
    "max_click_delay": 86400000,
    "min_click_delay": "1500"
  },
  "create_time": "2021-10-29 12:47:00",
  "update_time": "2021-10-30 14:27:26"
}
Responses

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.