Create Campaign

Create Campaign

POST https://api.ocamba.com/api/v1/adex/campaigns
Creates a new Campaign object

Request schema

body
curl -X POST \
 "https://api.ocamba.com/api/v1/adex/campaigns" \
  -H "Authorization: Bearer {TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
  "account_id": "1000000",
  "name": "My first campaign",
  "pricing_model": "cpm",
  "score": "60",
  "status": "active",
  "start_time": "2020-10-14 10:00"
}'
const url = 'https://api.ocamba.com/api/v1/adex/campaigns';
const options = {
  method: 'POST',
  headers: {
    Authorization: "Bearer {TOKEN}",
    'Content-Type': "application/json"
  },
  body: JSON.stringify(
    {
      "account_id": "1000000",
      "name": "My first campaign",
      "pricing_model": "cpm",
      "score": "60",
      "status": "active",
      "start_time": "2020-10-14 10:00"
    }
  )
};

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/api/v1/adex/campaigns");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer {TOKEN}",
  "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
  [
    "account_id" => "1000000",
    "name" => "My first campaign",
    "pricing_model" => "cpm",
    "score" => "60",
    "status" => "active",
    "start_time" => "2020-10-14 10:00"
  ]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Responses

201 Created

{
  "id": "1009154"
}
Responses