Docs

Get started

Welcome to ABRouter docs. It's a tool for AB-testing your application on the back-end side.
Running experiments is performs through simple HTTPS-request to ABRouter server.

Preparing

Before making a request you need to prepare the following:

  1. User id. It's your internal id or even session id. If your user is not signed up you can generate it on demand.
  2. Experiment id. You can get in at your dashboard.
  3. Authorization token. You're can also get it in your personal dashboard. Token will protect your app from unauthorized access.

Also you can find request template in your personal dashboard. Choose experiment, then click "Edit", scroll down and copy "Try link"

Request Example

So, after preparing we're ready to make a request. Requesting to run experiment for user is pretty simple. Let's make it:

POST https://abrouter.com/api/v1/experiment/run
With
Authorization 2c0d967a245c04b5f67ccc059af91257ba0249acdcb0d65b8583b9588227fb709dae3c043a313e71

And payload:
{
	"data": {
		"type": "experiment-run",
		"attributes": {
            "userSignature": "asds21"
    	},
        "relationships": {
            "experiment": {
                "data": {
                    "id": "B95AC000-0000-0000-00005030",
                    "type": "experiments"
                }
            }
        }
	}
}
                
Will respond the following:
                    {
    "data": {
        "type": "experiment_branch_users",
        "id": "26DAA100-0000-0000-00006E5F",
        "attributes": {
            "run-uid": "button-green",
            "branch-uid": "green",
            "experiment-uid": "button"
        },
        "relationships": {
            "experiment_user": {
                "data": {
                    "type": "experiment_user",
                    "id": "9A187100-0000-0000-0000CC34"
                }
            },
            "experiment_id": {
                "data": {
                    "type": "users",
                    "id": "B95AC000-0000-0000-00005030"
                }
            },
            "experiment_branch_id": {
                "data": {
                    "type": "users",
                    "id": "BD950100-0000-0000-00007B95"
                }
            }
        }
    }
}
                

Ready to use ?

Review our guide how to ABRouter use with PHP clients:

Launch your first A/B test on ABRouter with PHP without target to any framework
Get started using ABRouter with Laravel framework