Create Campaign targeting
Create Campaign targeting
POST
https://api.ocamba.com/api/v1/adex/targeting
Creates a new Campaign targeting objectRequest schema
bodyResponse schemas
›
200
application/json
curl -X POST \
"https://api.ocamba.com/api/v1/adex/targeting" \
-H "Authorization: Bearer {TOKEN}" \
-H "Content-Type: application/json" \
-d '"{\n\t\"campaign_id\": \"1008894\",\n\t\"ip\": null,\n\t\"country\": {\n\t\t\"item\": [\"ES\", \"IL\", \"MN\"],\n\t\t\"op\": \"exclude\",\n\t\t\"list\": [1, 10, 431]\n\t},\n\t\"browser\": [{\n\t\t\t\"id\": 12,\n\t\t\t\"op\": \"exact\",\n\t\t\t\"version\": [\"74.0\"]\n\t\t},\n\t\t{\n\t\t\t\"id\": 17,\n\t\t\t\"op\": \"exact\",\n\t\t\t\"version\": [\"40.0\", \"38.0\"]\n\t\t}\n\t],\n\t\"traffic\": {\n\t\t\"item\": [2, 3, 7],\n\t\t\"op\": \"exclude\"\n\t},\n\t\"device_tracking\": {\n\t\t\"is_turned_on\": \"1\"\n\t},\n\t\"device_type\": {\n\t\t\"item\": [\"mobile\"],\n\t\t\"op\": \"include\"\n\t},\n\t\"time\": {\n\t\t\"item\": [\"0 10,11,12 * * 5,6\", \"0 14 1 * *\"],\n\t\t\"op\": \"include\"\n\t},\n}"'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(
"{\n\t\"campaign_id\": \"1008894\",\n\t\"ip\": null,\n\t\"country\": {\n\t\t\"item\": [\"ES\", \"IL\", \"MN\"],\n\t\t\"op\": \"exclude\",\n\t\t\"list\": [1, 10, 431]\n\t},\n\t\"browser\": [{\n\t\t\t\"id\": 12,\n\t\t\t\"op\": \"exact\",\n\t\t\t\"version\": [\"74.0\"]\n\t\t},\n\t\t{\n\t\t\t\"id\": 17,\n\t\t\t\"op\": \"exact\",\n\t\t\t\"version\": [\"40.0\", \"38.0\"]\n\t\t}\n\t],\n\t\"traffic\": {\n\t\t\"item\": [2, 3, 7],\n\t\t\"op\": \"exclude\"\n\t},\n\t\"device_tracking\": {\n\t\t\"is_turned_on\": \"1\"\n\t},\n\t\"device_type\": {\n\t\t\"item\": [\"mobile\"],\n\t\t\"op\": \"include\"\n\t},\n\t\"time\": {\n\t\t\"item\": [\"0 10,11,12 * * 5,6\", \"0 14 1 * *\"],\n\t\t\"op\": \"include\"\n\t},\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/api/v1/adex/targeting");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {TOKEN}",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
"[\n\t\"campaign_id\" => \"1008894\",\n\t\"ip\" => null,\n\t\"country\" => [\n\t\t\"item\" => [\"ES\", \"IL\", \"MN\"],\n\t\t\"op\" => \"exclude\",\n\t\t\"list\" => [1, 10, 431]\n\t],\n\t\"browser\" => [[\n\t\t\t\"id\" => 12,\n\t\t\t\"op\" => \"exact\",\n\t\t\t\"version\" => [\"74.0\"]\n\t\t],\n\t\t[\n\t\t\t\"id\" => 17,\n\t\t\t\"op\" => \"exact\",\n\t\t\t\"version\" => [\"40.0\", \"38.0\"]\n\t\t]\n\t],\n\t\"traffic\" => [\n\t\t\"item\" => [2, 3, 7],\n\t\t\"op\" => \"exclude\"\n\t],\n\t\"device_tracking\" => [\n\t\t\"is_turned_on\" => \"1\"\n\t],\n\t\"device_type\" => [\n\t\t\"item\" => [\"mobile\"],\n\t\t\"op\" => \"include\"\n\t],\n\t\"time\" => [\n\t\t\"item\" => [\"0 10,11,12 * * 5,6\", \"0 14 1 * *\"],\n\t\t\"op\" => \"include\"\n\t],\n]"
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);Responses
200 OK
Responses