Create Ab test variation

Create Ab test variation

POST https://api.ocamba.com/v2/adex/campaign-ab-tests/{id}/variations
Creates a new Ab test variation object

Path parameters

parameters

Request schema

body
curl -X POST \
 "https://api.ocamba.com/v2/adex/campaign-ab-tests/{id}/variations" \
  -H "Authorization: Bearer {TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "image variation",
  "settings": {
    "landing_url": "https://google.com/",
    "image": {
      "en": "https://freeiconshop.com/wp-content/uploads/edd/image-outline-filled.png",
      "de": "https://freeiconshop.com/wp-content/uploads/edd/image-outline-filled.png"
    }
  }
}'
const url = 'https://api.ocamba.com/v2/adex/campaign-ab-tests/{id}/variations';
const options = {
  method: 'POST',
  headers: {
    Authorization: "Bearer {TOKEN}",
    'Content-Type': "application/json"
  },
  body: JSON.stringify(
    {
      "name": "image variation",
      "settings": {
        "landing_url": "https://google.com/",
        "image": {
          "en": "https://freeiconshop.com/wp-content/uploads/edd/image-outline-filled.png",
          "de": "https://freeiconshop.com/wp-content/uploads/edd/image-outline-filled.png"
        }
      }
    }
  )
};

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/campaign-ab-tests/{id}/variations");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer {TOKEN}",
  "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
  [
    "name" => "image variation",
    "settings" => [
      "landing_url" => "https://google.com/",
      "image" => [
        "en" => "https://freeiconshop.com/wp-content/uploads/edd/image-outline-filled.png",
        "de" => "https://freeiconshop.com/wp-content/uploads/edd/image-outline-filled.png"
      ]
    ]
  ]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Responses

201 Created

{
  "id": "12697",
  "name": "image variation",
  "settings": {
    "image": {
      "de": "https://sm.ocmcore.com/share/6197120/adex/media/708766246-1673870055961-image",
      "en": "https://sm.ocmcore.com/share/6197120/adex/media/708766246-1673870056676-image"
    },
    "image_size": {
      "de": "256x256",
      "en": "256x256"
    },
    "landing_url": "https://google.com/"
  },
  "create_time": "2023-01-16 11:54:15",
  "update_time": "2023-01-16 11:54:15"
}
Responses