Configure Creative distribution
Configure Creative distribution
POST
https://api.ocamba.com/v2/adex/campaigns/{campaign_id}/distribute
Configures the distribution for Creatives
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.
Rate limits:
- Burst: 10/s
- Steady: 150/m
Path parameters
parametersRequest schema
bodyResponse schemas
•
204
No Content
›
400
application/json
›
500
application/json
curl -X POST \
"https://api.ocamba.com/v2/adex/campaigns/{campaign_id}/distribute" \
-H "Authorization: Bearer {TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"status": 1,
"creatives": [
{
"id": "1223141",
"distribution_rate": 23,
"status": "active"
},
{
"id": "1223142",
"distribution_rate": 77,
"status": "active"
}
]
}'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(
{
"status": 1,
"creatives": [
{
"id": "1223141",
"distribution_rate": 23,
"status": "active"
},
{
"id": "1223142",
"distribution_rate": 77,
"status": "active"
}
]
}
)
};
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(
[
"status" => 1,
"creatives" => [
[
"id" => "1223141",
"distribution_rate" => 23,
"status" => "active"
],
[
"id" => "1223142",
"distribution_rate" => 77,
"status" => "active"
]
]
]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);Responses
204 No Content
400 Bad Request
{
"code": 400,
"title": "Bad request.",
"message": "The request is not valid.",
"trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}
500 Internal Server Error
{
"code": 500,
"title": "Internal server error.",
"trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}
Responses