Create Campaign targeting

Create Campaign targeting

POST https://api.ocamba.com/api/v1/adex/targeting
Creates a new Campaign targeting object

Note
We recommend using containers instead of tags, as tags are deprecated.

Rate limits:

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

Request schema

body

Response schemas

curl -X POST \
 "https://api.ocamba.com/api/v1/adex/targeting" \
  -H "Authorization: Bearer {TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
  "campaign_id": "1008894",
  "country": {
    "item": [
      "ES",
      "IL",
      "MN"
    ],
    "op": "exclude",
    "list": [
      1,
      10,
      431
    ]
  },
  "device_type": {
    "item": [
      "mobile"
    ],
    "op": "include"
  }
}'
const url = 'https://api.ocamba.com/api/v1/adex/targeting';
const options = {
  method: 'POST',
  headers: {
    Authorization: "Bearer {TOKEN}",
    'Content-Type': "application/json"
  },
  body: JSON.stringify(
    {
      "campaign_id": "1008894",
      "country": {
        "item": [
          "ES",
          "IL",
          "MN"
        ],
        "op": "exclude",
        "list": [
          1,
          10,
          431
        ]
      },
      "device_type": {
        "item": [
          "mobile"
        ],
        "op": "include"
      }
    }
  )
};

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/api/v1/adex/targeting");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer {TOKEN}",
  "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
  [
    "campaign_id" => "1008894",
    "country" => [
      "item" => [
        "ES",
        "IL",
        "MN"
      ],
      "op" => "exclude",
      "list" => [
        1,
        10,
        431
      ]
    ],
    "device_type" => [
      "item" => [
        "mobile"
      ],
      "op" => "include"
    ]
  ]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Responses

200 OK

{
  "country": {
    "item": "RS,US,JP",
    "list": "12,131",
    "op": "include"
  },
  "category": {
    "item": "IAB1,IAB1-1,IAB1-2",
    "list": "1231,3213",
    "op": "include"
  },
  "connection": {
    "item": "0,1,2",
    "op": "include"
  },
  "device_tracking": {},
  "device_manufacturer": {
    "item": "5,4,2",
    "op": "include"
  },
  "device_type": {
    "item": "mobile",
    "op": "include"
  },
  "ip": {
    "item": "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",
    "list": "193",
    "op": "include"
  },
  "referrer": {
    "item": "4231,5341",
    "list": "193",
    "op": "include"
  },
  "subid": {
    "item": "fut_t10_18-24-MULTI_GG",
    "list": "193",
    "op": "include"
  },
  "traffic": {
    "item": "1,2,3",
    "op": "include"
  },
  "browser": {
    "id": 12,
    "version": "78",
    "op": "exact"
  },
  "os": {
    "id": 12,
    "version": "1.5",
    "op": "exact"
  },
  "publisher": {
    "item": "123413,6242163",
    "op": "include"
  },
  "has_user_data": {},
  "user_data": {
    "op": "include"
  },
  "subscribed_age": {
    "time_unit": "day",
    "from": "10",
    "to": "15"
  },
  "time": {
    "item": [
      "0 14 1 * *"
    ],
    "op": "include"
  },
  "tag": {
    "item": [
      null
    ],
    "op": "include"
  },
  "containers": {
    "item": [
      null
    ],
    "op": "include"
  },
  "language": {
    "item": [
      "sr"
    ],
    "op": "include"
  }
}

400 Bad Request

500 Internal Server Error

Responses