Copy a Campaign

Copy a Campaign

POST https://api.ocamba.com/v2/adex/campaigns/{id}/copy
Copies an existing campaign object

Request schema

body
curl -X POST \
 "https://api.ocamba.com/v2/adex/campaigns/{id}/copy" \
  -H "Authorization: Bearer {TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "example_campaign_name",
  "status": "active"
}'
const url = 'https://api.ocamba.com/v2/adex/campaigns/{id}/copy';
const options = {
  method: 'POST',
  headers: {
    Authorization: "Bearer {TOKEN}",
    'Content-Type': "application/json"
  },
  body: JSON.stringify(
    {
      "name": "example_campaign_name",
      "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/{id}/copy");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer {TOKEN}",
  "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
  [
    "name" => "example_campaign_name",
    "status" => "active"
  ]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Responses

201 Created

{
  "id": "1001231",
  "company_id": "2233113",
  "name": "example_campaign_name",
  "status": "active",
  "create_time": "2021-10-29 12:47:00",
  "update_time": "2021-10-30 14:27:26"
}
Responses
Info
When copying a campaign through this endpoint, all it’s subresources will be copied as well. This includes campaign creatives, campaign limits, campaign modifiers, campaign pricing and campaign targeting.