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.
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/campaigns/{id}/messages/{mid}/set-winner HTTP/1.1
Host: api.ocamba.com
Authorization: Bearer YOUR_SECRET_TOKEN
curl -X POST "https://api.ocamba.com/v1/hood/campaigns/{id}/messages/{mid}/set-winner" \
-H "Authorization: Bearer $TOKEN"
fetch("https://api.ocamba.com/v1/hood/campaigns/{id}/messages/{mid}/set-winner", {
method: "POST",
headers: { Authorization: `Bearer ${TOKEN}` }
}).then(r => r.json());
$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
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 campaign 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 campaign.
2
You cannot set a message as the AB Test winner before the evaluation period ends.
3
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.