Splitforce API Documentation

Welcome on Splitforce API documentation page.

Get App Info and Experiments

Parameters

Name Description type
app_id required App ID String
app_key required App Key String

Request

Route

GET /api/v1/apps?app_id=my_app_id&app_key=my_app_key

Query Parameters

app_id=my_app_id
app_key=my_app_key

Response

Status

200

Body

{
  "name": "My App",
  "experiments": [
    {
      "id": 1,
      "name": "Experiment 2",
      "app_id": 1,
      "description": "Experiment description",
      "created_at": "2014-08-27T17:32:23+08:00",
      "updated_at": "2014-08-30T17:32:26+08:00",
      "goals": [
        "Example Rate Goal",
        "Example Quantified Goal",
        "Example Timed Goal"
      ],
      "segments": [
        {
          "id": 1,
          "name": "Default",
          "is_finished": false,
          "variations": [
            {
              "name": "B",
              "frequency": 50,
              "is_winner": false,
              "is_deleted": false,
              "updated_at": "2014-08-30T17:32:26+08:00"
            },
            {
              "name": "A",
              "frequency": 50,
              "is_winner": false,
              "is_deleted": false,
              "updated_at": "2014-08-30T17:32:26+08:00"
            }
          ]
        },
        {
          "id": 2,
          "name": "Default",
          "is_finished": false,
          "variations": [
            {
              "name": "B",
              "frequency": 50,
              "is_winner": false,
              "is_deleted": false,
              "updated_at": "2014-08-30T17:32:26+08:00"
            },
            {
              "name": "A",
              "frequency": 50,
              "is_winner": false,
              "is_deleted": false,
              "updated_at": "2014-08-30T17:32:26+08:00"
            }
          ]
        }
      ]
    },
    {
      "id": 2,
      "name": "Experiment 1",
      "app_id": 1,
      "description": "Experiment description",
      "created_at": "2014-08-27T17:32:23+08:00",
      "updated_at": "2014-08-30T17:32:26+08:00",
      "goals": [
        "Example Rate Goal",
        "Example Quantified Goal",
        "Example Timed Goal"
      ],
      "segments": [
        {
          "id": 3,
          "name": "Default",
          "is_finished": false,
          "variations": [
            {
              "name": "B",
              "frequency": 50,
              "is_winner": false,
              "is_deleted": false,
              "updated_at": "2014-08-30T17:32:26+08:00"
            },
            {
              "name": "A",
              "frequency": 50,
              "is_winner": false,
              "is_deleted": false,
              "updated_at": "2014-08-30T17:32:26+08:00"
            }
          ]
        },
        {
          "id": 4,
          "name": "Default",
          "is_finished": false,
          "variations": [
            {
              "name": "B",
              "frequency": 50,
              "is_winner": false,
              "is_deleted": false,
              "updated_at": "2014-08-30T17:32:26+08:00"
            },
            {
              "name": "A",
              "frequency": 50,
              "is_winner": false,
              "is_deleted": false,
              "updated_at": "2014-08-30T17:32:26+08:00"
            }
          ]
        }
      ]
    }
  ]
}

Update

Parameters

Name Description type
app_id required App ID String
app_key required App Key String
name App Name String
description Description String

Request

Route

PUT /api/v1/apps

Body

app_id=my_app_id&app_key=my_app_key&name=New+App+Name&description=New+App+Description

Response

Status

204

Get Experiment Info

Parameters

Name Description type
app_id required App ID String
app_key required App Key String
id required Experiment ID Integer

Request

Route

GET /api/v1/experiments/1?app_id=my_app_id&app_key=my_app_key

Query Parameters

app_id=my_app_id
app_key=my_app_key

Response

Status

200

Body

{
  "id": 1,
  "name": "Experiment 2",
  "app_id": 1,
  "description": "Experiment description",
  "created_at": "2014-08-27T17:32:23+08:00",
  "updated_at": "2014-08-30T17:32:26+08:00",
  "goals": [
    "Example Rate Goal",
    "Example Quantified Goal",
    "Example Timed Goal"
  ],
  "segments": [
    {
      "id": 1,
      "name": "Default",
      "is_finished": false,
      "variations": [
        {
          "name": "B",
          "frequency": 50,
          "is_winner": false,
          "is_deleted": false,
          "updated_at": "2014-08-30T17:32:26+08:00"
        },
        {
          "name": "A",
          "frequency": 50,
          "is_winner": false,
          "is_deleted": false,
          "updated_at": "2014-08-30T17:32:26+08:00"
        }
      ]
    },
    {
      "id": 2,
      "name": "Default",
      "is_finished": false,
      "variations": [
        {
          "name": "B",
          "frequency": 50,
          "is_winner": false,
          "is_deleted": false,
          "updated_at": "2014-08-30T17:32:26+08:00"
        },
        {
          "name": "A",
          "frequency": 50,
          "is_winner": false,
          "is_deleted": false,
          "updated_at": "2014-08-30T17:32:26+08:00"
        }
      ]
    }
  ]
}

Get results for a quantified goal

Parameters

Name Description type
app_id required App ID String
app_key required App Key String
id required Experiment ID Integer
segment_id Segment ID Integer
goal required Goal Name String
goal_type required Goal Type String
from Results from this date Date
to Results to this date Date

Request

Route

GET /api/v1/experiments/2/results?app_id=my_app_id&app_key=my_app_key&goal=Example+Quantified+Goal&goal_type=Quantity&from=2014-08-27&to=2014-08-30

Query Parameters

app_id=my_app_id
app_key=my_app_key
goal=Example Quantified Goal
goal_type=Quantity
from=2014-08-27
to=2014-08-30

Response

Status

200

Body

{
  "goal_name": "Example Quantified Goal",
  "goal_type": "Quantity",
  "segment_name": "Default",
  "results": [
    {
      "B": 0.99,
      "A": 0.61,
      "date": "2014-08-27"
    },
    {
      "B": 0.79,
      "A": 1.28,
      "date": "2014-08-28"
    },
    {
      "B": 0.68,
      "A": 1.05,
      "date": "2014-08-29"
    },
    {
      "B": 1.1,
      "A": 0.85,
      "date": "2014-08-30"
    }
  ]
}

Get results for a rate goal

Parameters

Name Description type
app_id required App ID String
app_key required App Key String
id required Experiment ID Integer
segment_id Segment ID Integer
goal required Goal Name String
goal_type required Goal Type String
from Results from this date Date
to Results to this date Date

Request

Route

GET /api/v1/experiments/2/results?app_id=my_app_id&app_key=my_app_key&goal=Example+Rate+Goal&goal_type=Rate&from=2014-08-27&to=2014-08-30

Query Parameters

app_id=my_app_id
app_key=my_app_key
goal=Example Rate Goal
goal_type=Rate
from=2014-08-27
to=2014-08-30

Response

Status

200

Body

{
  "goal_name": "Example Rate Goal",
  "goal_type": "Rate",
  "segment_name": "Default",
  "results": [
    {
      "B": 30.0,
      "A": 34.0,
      "date": "2014-08-27"
    },
    {
      "B": 90.0,
      "A": 63.0,
      "date": "2014-08-28"
    },
    {
      "B": 21.0,
      "A": 71.0,
      "date": "2014-08-29"
    },
    {
      "B": 73.0,
      "A": 95.0,
      "date": "2014-08-30"
    }
  ]
}

Get results for a timed goal

Parameters

Name Description type
app_id required App ID String
app_key required App Key String
id required Experiment ID Integer
segment_id Segment ID Integer
goal required Goal Name String
goal_type required Goal Type String
from Results from this date Date
to Results to this date Date

Request

Route

GET /api/v1/experiments/2/results?app_id=my_app_id&app_key=my_app_key&goal=Example+Timed+Goal&goal_type=Timing&from=2014-08-27&to=2014-08-30

Query Parameters

app_id=my_app_id
app_key=my_app_key
goal=Example Timed Goal
goal_type=Timing
from=2014-08-27
to=2014-08-30

Response

Status

200

Body

{
  "goal_name": "Example Timed Goal",
  "goal_type": "Timing",
  "segment_name": "Default",
  "results": [
    {
      "B": 372.0,
      "A": 439.0,
      "date": "2014-08-27"
    },
    {
      "B": 294.0,
      "A": 165.0,
      "date": "2014-08-28"
    },
    {
      "B": 207.0,
      "A": 32.0,
      "date": "2014-08-29"
    },
    {
      "B": 123.0,
      "A": 76.0,
      "date": "2014-08-30"
    }
  ]
}