Get an A/B test
const url = 'https://api.getsitecontrol.com/v1/sites/1/widgets/ab-tests/1';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.getsitecontrol.com/v1/sites/1/widgets/ab-tests/1 \ --header 'Authorization: Bearer <token>'One A/B test as List A/B tests gives it. findings are facts about the test setup: widgets whose targeting differs (pages, audience, devices, schedule, trigger, frequency), switches after the results started counting, one widget on, a widget without views and what its settings show; tell the user each one with what to do. The widget card’s ab_test_group.id is the test id.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”A/B test id from List A/B tests
A/B test id from List A/B tests
Responses
Section titled “Responses”object
The admin’s slot, shown there as Test 1 … Test 5
The widget ahead: the highest CTR, ties to the first listed; the one Stop keeps unless told otherwise
In the admin’s order; at least one. Visitors are split evenly between the widgets that are on
object
An off widget stays in the test but is not shown; a test shows its widgets that are on
Results counted from: when the widget joined the test or the results were last reset
Counts by event type since added_at: show (views) and every action the widget has now — submit (forms sent), openUrl, showWidget, addToCart, applyCoupon, copyToClipboard (button clicks); only the keys the widget has
object
Times the widget was shown since added_at; total.show. The admin’s Views
Forms sent and buttons used since added_at: every key of total but show, summed. The admin’s Actions
actions / views as a fraction, the admin’s CTR rounded half up to 4 places (0.0325 is 3.25%); 0 while there are no views
Facts the server worked out about the test: targeting that differs between the widgets, one widget on, on/off switches since added_at, a widget without views; empty when there is nothing to say
object
Targeting_differs: the widgets differ in the targeting block named in detail; single_widget_on: only one widget of the test is on, every visitor gets it; switched: the widget was turned off or on after its results started counting; no_switch_history: the widget’s results count from before on/off history was kept, so switches before that are unknown; no_views: the widget has no views since added_at, detail says what its settings show.
The widgets the finding is about
One short sentence with the facts, in the user’s terms; wording is not stable, do not parse
{ "findings": [ { "kind": "targeting_differs" } ]}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
Authentication scheme: Bearer
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
ab_test_not_found: the site has no such test, or it was stopped
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
Seconds until the bucket refills
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds