Configure Creative distribution
Configure Creative distribution
POST
https://api.ocamba.com/v2/adex/campaigns/{campaign_id}/distribute
Configures the distribution for CreativesPath parameters
parametersRequest schema
bodyResponse schemas
•
204
No Content
curl -X POST \
"https://api.ocamba.com/v2/adex/campaigns/{campaign_id}/distribute" \
-H "Authorization: Bearer {TOKEN}" \
-H "Content-Type: application/json" \
-d '"{\n \"status\": 1,\n \"creatives\": [\n {\n \"id\": \"1223141\",\n \"distribution_rate\": 23,\n \"status\": \"active\",\n },\n {\n \"id\": \"1223142\",\n \"distribution_rate\": 77,\n \"status\": \"active\"\n }\n ]\n}"'const url = 'https://api.ocamba.com/v2/adex/campaigns/{campaign_id}/distribute';
const options = {
method: 'POST',
headers: {
Authorization: "Bearer {TOKEN}",
'Content-Type': "application/json"
},
body: JSON.stringify(
"{\n \"status\": 1,\n \"creatives\": [\n {\n \"id\": \"1223141\",\n \"distribution_rate\": 23,\n \"status\": \"active\",\n },\n {\n \"id\": \"1223142\",\n \"distribution_rate\": 77,\n \"status\": \"active\"\n }\n ]\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/v2/adex/campaigns/{campaign_id}/distribute");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {TOKEN}",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
"[\n \"status\" => 1,\n \"creatives\" => [\n [\n \"id\" => \"1223141\",\n \"distribution_rate\" => 23,\n \"status\" => \"active\",\n ],\n [\n \"id\" => \"1223142\",\n \"distribution_rate\" => 77,\n \"status\" => \"active\"\n ]\n ]\n]"
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);Responses
204 No Content
Responses
Tip
If you don’t know the campaign id, list the campaigns to find it.
If you don’t know the creative id, list the creative to find it.
Note
All creative ids must belong to the same campaign.
Sum of distribution rates across all active creatives on a campaign must be 100.