Set Message As AB Test Winner

Set Message As AB Test Winner

POST https://api.ocamba.com/v1/hood/campaigns/{id}/messages/{mid}/set-winner
Sets the specified message as the winner of an A/B test for a given campaign. This operation finalizes the A/B test, marking the selected message as the winning variant. The campaign will use this message for future deliveries.

Tip

You can find the eligable message id’s by viewing the designated campaign.

You cannot set a message as the AB Test winner before the evaluation period ends.

If a campaign was set to automatically, and ends it’s evaluation period with a draw, then it will turn it’s delivery mode to manual, and send a mail to the creator of the campaign, so they would decide on the winner themselves.

Rate limits:

  • Burst: 10/s
  • Steady: 150/m

Path parameters

parameters

Response schemas

204
No Content
curl -X POST \
 "https://api.ocamba.com/v1/hood/campaigns/{id}/messages/{mid}/set-winner" \
  -H "Authorization: Bearer {TOKEN}"
const url = 'https://api.ocamba.com/v1/hood/campaigns/{id}/messages/{mid}/set-winner';
const options = {
  method: 'POST',
  headers: {
    Authorization: `Bearer {TOKEN}`
  }
};

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/v1/hood/campaigns/{id}/messages/{mid}/set-winner");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer {TOKEN}"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Responses

204 No Content

400 Bad Request

{
  "code": 400,
  "title": "Bad request.",
  "message": "Specified campaign does not exist, or hasn't finished it's testing phase.",
  "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