Set Message As AB Test Winner

Set Message As AB Test Winner

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

Tip

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

You cannot set a message as the A/B test winner until the evaluation period has ended or the required number of appears has been reached.

If a prompt is set to run automatically and its evaluation period ends in a draw (i.e., no clear winner), or the required number of appearances is reached without a winner, it will switch to manual delivery mode. Then, the user will need to decide on the winning variation manually.

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/containers/{id}/prompts/{pid}/messages/{messid}/set-winner" \
  -H "Authorization: Bearer {TOKEN}"
const url = 'https://api.ocamba.com/v1/hood/containers/{id}/prompts/{pid}/messages/{messid}/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/containers/{id}/prompts/{pid}/messages/{messid}/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 prompt 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