Create Campaign pricing
Create Campaign pricing
POST
https://api.ocamba.com/v2/adex/campaigns/{id}/pricing
Creates a new Campaign pricing objectPath parameters
parametersRequest schema
bodycurl -X POST \
"https://api.ocamba.com/v2/adex/campaigns/{id}/pricing" \
-H "Authorization: Bearer {TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"currency_code": "USD",
"price": 1,
"conversion_repeat": "1",
"modifier_type": "exact-value",
"modifiers": [
{
"value": -0.5,
"countries": [
"RS"
]
},
{
"value": 0.5,
"countries": [
"US"
]
}
]
}'const url = 'https://api.ocamba.com/v2/adex/campaigns/{id}/pricing';
const options = {
method: 'POST',
headers: {
Authorization: "Bearer {TOKEN}",
'Content-Type': "application/json"
},
body: JSON.stringify(
{
"currency_code": "USD",
"price": 1,
"conversion_repeat": "1",
"modifier_type": "exact-value",
"modifiers": [
{
"value": -0.5,
"countries": [
"RS"
]
},
{
"value": 0.5,
"countries": [
"US"
]
}
]
}
)
};
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/{id}/pricing");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {TOKEN}",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
[
"currency_code" => "USD",
"price" => 1,
"conversion_repeat" => "1",
"modifier_type" => "exact-value",
"modifiers" => [
[
"value" => -0.5,
"countries" => [
"RS"
]
],
[
"value" => 0.5,
"countries" => [
"US"
]
]
]
]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);Responses
201 Created
{
"company_id": "6197120",
"campaign_id": "1010782",
"currency_code": "USD",
"price": 1,
"conversion_repeat": "1",
"modifier_type": "exact-value",
"modifiers": [
{
"id": "f7d84d7b-3fe5-4a86-a30a-2423e2ea8a2f",
"value": -0.5,
"countries": [
"RS"
]
},
{
"id": "4ab6575e-a118-4ede-b57b-1e67a1891706",
"value": 0.5,
"countries": [
"US"
]
}
]
}
Responses