Create Campaign creative
Create Campaign creative
POST
https://api.ocamba.com/v2/adex/campaigns/{campaign_id}/creatives
Creates a new Campaign creative objectPath parameters
parametersRequest schema
bodycurl -X POST \
"https://api.ocamba.com/v2/adex/campaigns/{campaign_id}/creatives" \
-H "Authorization: Bearer {TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"campaign_id": 1006454,
"name": "Demo dynamic native",
"type": "dynamic-native",
"status": "inactive",
"title": {
"en": "en title",
"sr": "sr title"
},
"image": {
"en": "http://example.domen/image/en.jpg",
"sr": "http://example.domen/image/sr.jpg"
},
"landing_url": "http://www.delsystems.net",
"target": "_blank",
"advertiser_domain": "www.delsystems.net"
}'const url = 'https://api.ocamba.com/v2/adex/campaigns/{campaign_id}/creatives';
const options = {
method: 'POST',
headers: {
Authorization: "Bearer {TOKEN}",
'Content-Type': "application/json"
},
body: JSON.stringify(
{
"campaign_id": 1006454,
"name": "Demo dynamic native",
"type": "dynamic-native",
"status": "inactive",
"title": {
"en": "en title",
"sr": "sr title"
},
"image": {
"en": "http://example.domen/image/en.jpg",
"sr": "http://example.domen/image/sr.jpg"
},
"landing_url": "http://www.delsystems.net",
"target": "_blank",
"advertiser_domain": "www.delsystems.net"
}
)
};
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/campaigns/{campaign_id}/creatives");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {TOKEN}",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
[
"campaign_id" => 1006454,
"name" => "Demo dynamic native",
"type" => "dynamic-native",
"status" => "inactive",
"title" => [
"en" => "en title",
"sr" => "sr title"
],
"image" => [
"en" => "http://example.domen/image/en.jpg",
"sr" => "http://example.domen/image/sr.jpg"
],
"landing_url" => "http://www.delsystems.net",
"target" => "_blank",
"advertiser_domain" => "www.delsystems.net"
]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);curl -X POST \
"https://api.ocamba.com/v2/adex/campaigns/{campaign_id}/creatives" \
-H "Authorization: Bearer {TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"campaign_id": 1001114,
"name": "Demo dynamic native external demand",
"type": "dynamic-native-external-demand",
"status": "active",
"title": {
"en": "en title",
"sr": "sr title"
},
"image": {
"en": "http://example.domen/image/en.jpg",
"sr": "http://example.domen/image/sr.jpg"
},
"landing_url": "http://www.delsystems.net",
"target": "_blank",
"advertiser_domain": "www.delsystems.net",
"override": {
"title": 0,
"image": 0,
"target": 0
}
}'const url = 'https://api.ocamba.com/v2/adex/campaigns/{campaign_id}/creatives';
const options = {
method: 'POST',
headers: {
Authorization: "Bearer {TOKEN}",
'Content-Type': "application/json"
},
body: JSON.stringify(
{
"campaign_id": 1001114,
"name": "Demo dynamic native external demand",
"type": "dynamic-native-external-demand",
"status": "active",
"title": {
"en": "en title",
"sr": "sr title"
},
"image": {
"en": "http://example.domen/image/en.jpg",
"sr": "http://example.domen/image/sr.jpg"
},
"landing_url": "http://www.delsystems.net",
"target": "_blank",
"advertiser_domain": "www.delsystems.net",
"override": {
"title": 0,
"image": 0,
"target": 0
}
}
)
};
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/campaigns/{campaign_id}/creatives");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {TOKEN}",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
[
"campaign_id" => 1001114,
"name" => "Demo dynamic native external demand",
"type" => "dynamic-native-external-demand",
"status" => "active",
"title" => [
"en" => "en title",
"sr" => "sr title"
],
"image" => [
"en" => "http://example.domen/image/en.jpg",
"sr" => "http://example.domen/image/sr.jpg"
],
"landing_url" => "http://www.delsystems.net",
"target" => "_blank",
"advertiser_domain" => "www.delsystems.net",
"override" => [
"title" => 0,
"image" => 0,
"target" => 0
]
]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);curl -X POST \
"https://api.ocamba.com/v2/adex/campaigns/{campaign_id}/creatives" \
-H "Authorization: Bearer {TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"campaign_id": 1010580,
"name": "Demo web push object",
"type": "web-push-object",
"status": "active",
"title": {
"en": "Samsung J5"
},
"body": {
"en": "Samsung Galaxy J5 smartphone was launched in June 2015."
},
"icon": "https://example_icon.png",
"image": {
"en": "https://example_image.jpg"
},
"landing_url": "https://www.ocamba.com",
"actions": [
{
"title": {
"en": "Yes",
"sr": "Da"
},
"url": "https://www.delsystems.net"
},
{
"title": {
"en": "No",
"sr": "Ne"
}
}
]
}'const url = 'https://api.ocamba.com/v2/adex/campaigns/{campaign_id}/creatives';
const options = {
method: 'POST',
headers: {
Authorization: "Bearer {TOKEN}",
'Content-Type': "application/json"
},
body: JSON.stringify(
{
"campaign_id": 1010580,
"name": "Demo web push object",
"type": "web-push-object",
"status": "active",
"title": {
"en": "Samsung J5"
},
"body": {
"en": "Samsung Galaxy J5 smartphone was launched in June 2015."
},
"icon": "https://example_icon.png",
"image": {
"en": "https://example_image.jpg"
},
"landing_url": "https://www.ocamba.com",
"actions": [
{
"title": {
"en": "Yes",
"sr": "Da"
},
"url": "https://www.delsystems.net"
},
{
"title": {
"en": "No",
"sr": "Ne"
}
}
]
}
)
};
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/campaigns/{campaign_id}/creatives");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {TOKEN}",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
[
"campaign_id" => 1010580,
"name" => "Demo web push object",
"type" => "web-push-object",
"status" => "active",
"title" => [
"en" => "Samsung J5"
],
"body" => [
"en" => "Samsung Galaxy J5 smartphone was launched in June 2015."
],
"icon" => "https://example_icon.png",
"image" => [
"en" => "https://example_image.jpg"
],
"landing_url" => "https://www.ocamba.com",
"actions" => [
[
"title" => [
"en" => "Yes",
"sr" => "Da"
],
"url" => "https://www.delsystems.net"
],
[
"title" => [
"en" => "No",
"sr" => "Ne"
]
]
]
]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);curl -X POST \
"https://api.ocamba.com/v2/adex/campaigns/{campaign_id}/creatives" \
-H "Authorization: Bearer {TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"campaign_id": 1006302,
"name": "Demo web push exchange",
"type": "web-push-exchange",
"status": "active",
"title": {
"en": "New Important Message"
},
"body": {
"en": "Click Here"
},
"landing_url": "https://www.ocamba.com",
"language_direction": "ltr",
"renotify": 0,
"silent": 0,
"require_interaction": 0,
"postback": 1,
"vibration": "0,400,800",
"override": {
"body": 1,
"icon": 0,
"image": 0,
"landing_url": 1,
"title": 0
},
"actions": [
{
"title": {
"en": "Read Message"
},
"url": "https://www.delsystems.net"
}
]
}'const url = 'https://api.ocamba.com/v2/adex/campaigns/{campaign_id}/creatives';
const options = {
method: 'POST',
headers: {
Authorization: "Bearer {TOKEN}",
'Content-Type': "application/json"
},
body: JSON.stringify(
{
"campaign_id": 1006302,
"name": "Demo web push exchange",
"type": "web-push-exchange",
"status": "active",
"title": {
"en": "New Important Message"
},
"body": {
"en": "Click Here"
},
"landing_url": "https://www.ocamba.com",
"language_direction": "ltr",
"renotify": 0,
"silent": 0,
"require_interaction": 0,
"postback": 1,
"vibration": "0,400,800",
"override": {
"body": 1,
"icon": 0,
"image": 0,
"landing_url": 1,
"title": 0
},
"actions": [
{
"title": {
"en": "Read Message"
},
"url": "https://www.delsystems.net"
}
]
}
)
};
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/campaigns/{campaign_id}/creatives");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {TOKEN}",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
[
"campaign_id" => 1006302,
"name" => "Demo web push exchange",
"type" => "web-push-exchange",
"status" => "active",
"title" => [
"en" => "New Important Message"
],
"body" => [
"en" => "Click Here"
],
"landing_url" => "https://www.ocamba.com",
"language_direction" => "ltr",
"renotify" => 0,
"silent" => 0,
"require_interaction" => 0,
"postback" => 1,
"vibration" => "0,400,800",
"override" => [
"body" => 1,
"icon" => 0,
"image" => 0,
"landing_url" => 1,
"title" => 0
],
"actions" => [
[
"title" => [
"en" => "Read Message"
],
"url" => "https://www.delsystems.net"
]
]
]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);Responses
201 Created
{
"id": 1000004,
"campaign_id": 1006454,
"name": "Demo dynamic native",
"type": "dynamic-native",
"status": "inactive",
"title": {
"en": "en title",
"sr": "sr title"
},
"image": {
"en": "http://example.domen/image/en.jpg",
"sr": "http://example.domen/image/sr.jpg"
},
"image_sizes": {
"en": "500x300",
"sr": "640x480"
},
"landing_url": "http://www.delsystems.net",
"target": "_blank",
"advertiser_domain": "www.delsystems.net"
}
Responses
Note
This resource can only be added to the internal campaign type.
Path parameter campaign_id is only useable on campaigns/{cid}/creatives routes. It is represented by {cid}.