Set Message As AB Test Winner
Set Message As AB Test Winner
POST
https://api.ocamba.com/v1/hood/containers/{id}/modals/{mid}/messages/{messid}/set-winner
Sets the specified message as the winner of an A/B test for a given modal. This operation finalizes the A/B test, marking the selected message as the winning variant. The modal will use this message for future deliveries.
Rate limits:
Burst: 10/s
Steady: 150/m
Path parameters
parametersResponse schemas
›
400
application/json
›
500
application/json
POST https://api.ocamba.com/v1/hood/containers/{id}/modals/{mid}/messages/{messid}/set-winner HTTP/1.1
Host: api.ocamba.com
Authorization: Bearer YOUR_SECRET_TOKEN
curl -X POST "https://api.ocamba.com/v1/hood/containers/{id}/modals/{mid}/messages/{messid}/set-winner" \
-H "Authorization: Bearer $TOKEN"
fetch("https://api.ocamba.com/v1/hood/containers/{id}/modals/{mid}/messages/{messid}/set-winner", {
method: "POST",
headers: { Authorization: `Bearer ${TOKEN}` }
}).then(r => r.json());
$ch = curl_init("https://api.ocamba.com/v1/hood/containers/{id}/modals/{mid}/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
HTTP/1.1 204 No Content
Content-Type: application/json
400 Bad Request
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"code": 400,
"title": "Bad request.",
"message": "Specified modal does not exist, or hasn't finished it's testing phase.",
"trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}
500 Internal Server Error
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
{
"code": 500,
"title": "Internal server error.",
"trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}
Responses
Tip
1
You can find the eligable message id’s by viewing the designated modals.
2
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.
3
If a modal 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.