Create Campaign Ab test
Create Campaign Ab test
POST
https://api.ocamba.com/v2/adex/campaign-ab-tests
Creates a new Campaign Ab test objectRequest schema
bodycurl -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",
"targeting": {
"keywords": {
"items": [
"all|any",
"current"
],
"op": "eq"
},
"subids": {
"items": [
"14326"
],
"op": "eq"
}
},
"variations": [
{
"name": "TestNo3",
"settings": {
"landing_url": "https://google.com",
"image": {
"en": "https://freeiconshop.com/wp-content/uploads/edd/image-outline-filled.png",
"de": "https://freeiconshop.com/wp-content/uploads/edd/image-outline-filled.png"
},
"title": {
"en": "english",
"de": "deutsch"
}
}
}
]
}'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",
"targeting": {
"keywords": {
"items": [
"all|any",
"current"
],
"op": "eq"
},
"subids": {
"items": [
"14326"
],
"op": "eq"
}
},
"variations": [
{
"name": "TestNo3",
"settings": {
"landing_url": "https://google.com",
"image": {
"en": "https://freeiconshop.com/wp-content/uploads/edd/image-outline-filled.png",
"de": "https://freeiconshop.com/wp-content/uploads/edd/image-outline-filled.png"
},
"title": {
"en": "english",
"de": "deutsch"
}
}
}
]
}
)
};
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",
"targeting" => [
"keywords" => [
"items" => [
"all|any",
"current"
],
"op" => "eq"
],
"subids" => [
"items" => [
"14326"
],
"op" => "eq"
]
],
"variations" => [
[
"name" => "TestNo3",
"settings" => [
"landing_url" => "https://google.com",
"image" => [
"en" => "https://freeiconshop.com/wp-content/uploads/edd/image-outline-filled.png",
"de" => "https://freeiconshop.com/wp-content/uploads/edd/image-outline-filled.png"
],
"title" => [
"en" => "english",
"de" => "deutsch"
]
]
]
]
]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);Responses
201 Created
{
"id": "12845",
"company_id": "6197120",
"campaign_id": "1010797",
"creative_id": "1321448",
"name": "TestNo3",
"status": "inactive",
"start_time": "2024-11-05 11:28:59",
"end_time": "2024-12-04 00:00:00",
"stickiness": 1,
"targeting": {
"subids": {
"items": [
"14326"
],
"op": "eq"
},
"keywords": {
"items": [
"all|any",
"current"
]
}
},
"variation_count": 2,
"variations": [
{
"id": "12683",
"name": "Creative 3(Control)",
"is_control": true,
"create_time": "2023-01-16 07:53:36",
"update_time": "2023-01-16 07:53:36"
},
{
"id": "12684",
"name": "TestNo3",
"settings": {
"title": {
"de": "deutsch",
"en": "english"
},
"image": {
"de": "https://sm.ocmcore.com/share/6197120/adex/media/708766246-1673855617059-image",
"en": "https://sm.ocmcore.com/share/6197120/adex/media/708766246-1673855616275-image"
},
"image_size": {
"de": "256x256",
"en": "256x256"
},
"landing_url": "https://google.com"
},
"create_time": "2023-01-16 07:53:36",
"update_time": "2023-01-16 07:53:36"
}
]
}
Responses
Note
We recommend using containers instead of tags, as tags are deprecated. If both parameters are sent, containers will take priority.