Contents
On this page

Get A/B Test - Plugixa Chat

GET /plugixa-chat/v1/experiments/{id}

Read one test. Its figures come from A/B Test Results.

Needs Plugixa Chat Pro. The signed-in user needs the plugixa_chat_view capability. Administrators have it.

Request

GET https://your-site.example/wp-json/plugixa-chat/v1/experiments/7

Path parameters

Name Type Description
id integer The test’s id

Responses

200 OK. data is the test.

{
  "success": true,
  "data": {
    "id": 7,
    "name": "Green button or blue button",
    "widget_a": 2,
    "widget_b": 5,
    "split": 50,
    "status": "running",
    "started_at": "2026-11-12 09:40:00",
    "ended_at": null,
    "winner_id": 0,
    "deleted_at": null,
    "created_at": "2026-11-12 09:30:00",
    "modified_at": "2026-11-12 09:30:00",
    "created_by": "1",
    "modified_by": "1"
  }
}
Field Type Meaning
data.id integer The test’s id
data.widget_a, data.widget_b integer The two widgets compared
data.split integer Percentage of visitors shown widget A. The rest see B
data.status string draft, running or ended
data.started_at string|null UTC datetime it started, null for a draft
data.ended_at string|null UTC datetime it ended, null until then
data.winner_id integer The widget kept when it ended, 0 until then

Errors

Status Code When
404 plugixa_chat_not_found No test has this id, or it is in the trash.

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/plugixa-chat/v1/experiments/7" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-chat/v1/experiments/7');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-chat/v1/experiments/7', {
  headers: {
    'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
  },
});
const { data } = await response.json();

Quick Links

Share