Skip to content

Game Conductor API

Authentication

All the entries described here are authenticated until stated otherwise. The API expects HTTP Basic authentication with your username and your access token as the password. You can find your access token listed in the user settings.

For example if the documentation describes the following API:

GET https://api.gameconductor.net/some/path

A raw authenticated request would look like this:

> GET /some/path HTTP/1.1
> Host: api.gameconductor.net
> Authorization: Basic dXNlcm5hbWU6YWNjZXNzIHRva2Vu

< HTTP/1.1 200 OK

Learn more about Basic authentication on wikipedia. Most of the time the language of your choice will help you authenticate your requests. Here are some examples:

curl -u <username>:<access-token> https://api.gameconductor.net/v1/builds
from requests.auth import HTTPBasicAuth
import requests

auth=HTTPBasicAuth(username, access_token)
r = requests.get('https://api.gameconductor.net/v1/builds', auth=auth)
assert r.status_code == 200

Builds

Before you can run any tests on Game Conductor you need to upload your build (i.e. an archive of your game), including the tests you wrote.

Get a build-upload URL

Since the builds are stored on AWS S3, prior to the upload you need to request an URL and its parameters to be allowed to do so on the behalf of Game Conductor. The API will return the data you need to send the build to S3.

Request

GET https://api.gameconductor.net/v1/builds/upload-url

Code Samples

curl -u <username>:<access-token> --request GET https://api.gameconductor.net/v1/builds/upload-url
from requests.auth import HTTPBasicAuth
import requests

auth = HTTPBasicAuth(username, access_token)
r = requests.get('https://api.gameconductor.net/v1/builds/upload-url', auth=auth)
print(r.json())

Response

Status: 200 OK
{
  "build_id": "01776768-2392-36df-67b4-d7b082c09399",
  "s3": {
    "bucket": "0176c36b-1cf3-e9b4-f745-0306019f1525",
    "url": "https://s3.eu-central-1.amazonaws.com/0176c36b-1cf3-e9b4-f745-0306019f1525",
    "fields": {
      "key": "01776768-2392-36df-67b4-d7b082c09399",
      "x-amz-algorithm": "AWS4-HMAC-SHA256",
      "x-amz-credential": "test/20210203/local/s3/aws4_request",
      "x-amz-date": "20210203T102014Z",
      "policy": "eyJleHBpcmF0aW9uIjogIjIwMjEtMDItMDNUMTE7MjA6MTRaIiwgImNvbmRpdGlvbnMiOiBbeyJidWNrZXQiOiAiMDE3NmMzNmItMWNmMy1lOWI0LWY3NDUtMDMwNjAxOWYxNTI1In0sIHsia2V5IjogIjAxNzc2NzY4LTIzOTItMzZkZi02N2I0LWQ3YjA4MmMwOTM5OSJ9LCB7IngtYW16LWFsZ29yaXRobSI6ICJBV1M0LUhNQUMtU0hBMjU2In0sIHsieC1hbXotY3JlZGVudGlhbCI6ICJ0ZXN0LzIwMjEwMjAzL2xvY2FsL3MzL2F3czRfcmVxdWVzdCJ9LCB7IngtYW16LWRhdGUiOiAiMjAyMTAyMDNUMTAyMDE0WiJ9XA0=",
      "x-amz-signature": "4c7aa09b04ff927e611d4a8b0275239c869bc6a6a77a9faa81ca5e85b05fe4f6"
    }
  }
}

Create a new build

Request

POST https://api.gameconductor.net/v1/builds/new

Parameters

Name Type Where Description
build_id string body The id of the build, given from a build-upload URL
name string body The name given to the build
exec_file string body The file name of the executable in the archive

Code Samples

curl -u <username>:<access-token> \
--request POST https://api.gameconductor.net/v1/builds/new \
--header "Content-Type: application/json" \
--data '{
    "build_id": <build_id>,
    "name": "My Build",
    "exec_file": "Game.exe"
}'
from requests.auth import HTTPBasicAuth
import requests

auth = HTTPBasicAuth(username, access_token)
data = {
    "build_id": build_id",
    "name": ""My Build",
    "exec_file": "Game.exe"
}
r = requests.post('https://api.gameconductor.net/v1/builds/new', json=data, auth=auth)
print(r.json())

Sandard Response

Status: 200 OK
{
    "build_id": "01776768-2392-36df-67b4-d7b082c09399",
    "name": "My Build",
    "creation_date": "2021-02-03T10:20:35.257572Z",
    "exec_file": "Game.exe",
    "links": {
        "self": "https://api.gameconductor.net/v1/builds/01776768-2392-36df-67b4-d7b082c09399",
        "runs": "https://api.gameconductor.net/v1/runs?build=01776768-2392-36df-67b4-d7b082c09399"
    }
}

Errors

You can't create duplicates, so creating the same build twice (with the same id) will return an error.

Status: 400
{"detail": "Invalid build_id."}

Get information about a build

Request

GET https://api.gameconductor.net/v1/builds/{build_id}

Parameters

Name Type Where Description
build_id string path The id of the build

Code Samples

curl -u <username>:<access-token> --request GET https://api.gameconductor.net/v1/builds/<build_id>
from requests.auth import HTTPBasicAuth
import requests

auth = HTTPBasicAuth(username, access_token)
r = requests.get(f'https://api.gameconductor.net/v1/builds/{build_id}', auth=auth)
print(r.json())

Response

Status: 200 OK
{
    "build_id": "0176c39e-6cc3-ab0f-bb3a-2f101c26073a",
    "name": "Build v1.2",
    "creation_date": "2021-01-02T15:02:26.370435Z",
    "exec_file": "Build.exe",
    "links": {
    "self": "https://api.gameconductor.net/v1/builds/0176c39e-6cc3-ab0f-bb3a-2f101c26073a",
    "runs": "https://api.gameconductor.net/v1/runs?build=0176c39e-6cc3-ab0f-bb3a-2f101c26073a"
    }
}

Get the list of builds

You can retrieve the list of builds uploaded by your team to Game Conductor.

Request

GET https://api.gameconductor.net/v1/builds

Code Samples

curl -u <username>:<access-token> --request GET https://api.gameconductor.net/v1/builds 
from requests.auth import HTTPBasicAuth
import requests

auth = HTTPBasicAuth(username, access_token)
r = requests.get('https://api.gameconductor.net/v1/builds', auth=auth)
print(r.json())

Response

Status: 200 OK
[
{
    "build_id": "0176c39e-6cc3-ab0f-bb3a-2f101c26073a",
    "name": "Build v1.2",
    "creation_date": "2021-01-02T15:02:26.370435Z",
    "exec_file": "Build.exe",
    "links": {
    "self": "https://api.gameconductor.net/v1/builds/0176c39e-6cc3-ab0f-bb3a-2f101c26073a",
    "runs": "https://api.gameconductor.net/v1/runs?build=0176c39e-6cc3-ab0f-bb3a-2f101c26073a"
    }
},
{
    "build_id": "0176c3c6-27f9-1321-adb8-6c3916fcbd51",
    "name": "Build v1.3",
    "creation_date": "2021-01-02T15:45:21.817907Z",
    "exec_file": "Build.exe",
    "links": {
    "self": "https://api.gameconductor.net/v1/builds/0176c3c6-27f9-1321-adb8-6c3916fcbd51",
    "runs": "https://api.gameconductor.net/v1/runs?build=0176c3c6-27f9-1321-adb8-6c3916fcbd51"
    }
},
...
]

Runs

Launch (create) a new Run

Request

POST https://api.gameconductor.net/v1/runs/new?build_id={build_id}

Parameters

Name Type Where Description
build_id string query The id of the build
name string body The name of the run
test_names list of strings body A list of the tests to run (optional)
screen_capture boolean body If true, enables screen capture (optional)

If test_names is omitted, all the tests in the build will be run.

Note

Each test name has to follow this convention: <TestAssembly>.<TestClass>.<TestMethod>.

Code Samples

curl -u <username>:<access-token> \
--request GET https://api.gameconductor.net/v1/runs/new?build_id=<build_id> \
--header "Content-Type: application/json" \
--data '{
    "name": "My Run",
    "test_names": [
        "Tests.TestSuite.MyFirstTest",
        "Tests.TestSuite.MySecondTest"
    ],
    "screen_capture": true
}'
from requests.auth import HTTPBasicAuth
import requests

auth = HTTPBasicAuth(username, access_token)
params = {"build_id": build_id}
data = {
    "name": "My Run",
    "test_names": [
        "Tests.TestSuite.MyFirstTest",
        "Tests.TestSuite.MySecondTest"
    ],
    "screen_capture": True
} 
r = requests.post('https://api.gameconductor.net/v1/runs/new', params=params, json=data, auth=auth)
print(r.json())

Standard response

Status: 200 OK
{
  "run_id": "0177683e-c0db-f001-966e-468ce21769f6",
  "name": "Quick Test",
  "queued_date": "2021-02-03T14:14:39.067939Z",
  "start_date": null,
  "end_date": null,
  "status": "queued",
  "test_names": [],
  "tests_results": {},
  "screen_capture": false,
  "links": {
    "self": "https://api.gameconductor.net/v1/runs/0177683e-c0db-f001-966e-468ce21769f6",
    "build": "https://api.gameconductor.net/v1/builds/01776768-2392-36df-67b4-d7b082c09399"
  }
}

Errors

If your team has reached its concurrency limit (i.e. the number of runs allowed in parallel), launching a new run can return the following error:

Status: 429
{
    "detail": "You reached the maximum allowed concurrent runs for your team (2). Please retry later, or wait until a previous run has finished."
}


Get information about a run

Request

GET https://api.gameconductor.net/v1/runs/{run_id}

Parameters

Name Type Where Description
run_id string path The id of the run

Code Samples

curl -u <username>:<access-token> --request GET https://api.gameconductor.net/v1/runs/<run_id>
from requests.auth import HTTPBasicAuth
import requests

auth = HTTPBasicAuth(username, access_token)
r = requests.get(f'https://api.gameconductor.net/v1/runs/{run_id}', auth=auth)
print(r.json())

Standard response

Status: 200 OK
{
  "run_id": "0177687e-52cb-8a63-78f1-76144718c8c1",
  "name": "My Run",
  "queued_date": "2021-02-03T15:24:05.196489Z",
  "start_date": "2021-02-03T15:24:05.196489Z",
  "end_date": "2021-02-03T15:29:05.196489Z",
  "status": "passed",
  "test_names": [],
  "screen_capture": false,
  "tests_results": {
    "n_passed": 5,
    "n_failed": 0,
    "n_total": 5,
    "results": {
      "Tests.NewTestScript.NewTestScriptSimplePasses": {
        "status": "passed",
        "duration": 0.0062009,
        "message": "",
        "stacktrace": ""
      },
      "Tests.NewTestScript.NewTestScriptWithEnumeratorPasses": {
        "status": "passed",
        "duration": 0.0330191,
        "message": "",
        "stacktrace": ""
      },
      "Tests.TestSuite.SlashDamagesSkeleton": {
        "status": "passed",
        "duration": 1.7287376,
        "message": "",
        "stacktrace": ""
      },
      "Tests.TestSuite.TelekinesisChargeAndAbort": {
        "status": "passed",
        "duration": 0.9721921,
        "message": "",
        "stacktrace": ""
      },
      "Tests.TestSuite.TelekinesisChargeAndRelease": {
        "status": "passed",
        "duration": 1.8776448,
        "message": "",
        "stacktrace": ""
      }
    }
  },
  "links": {
    "self": "https://api.gameconductor.net/v1/runs/0177687e-52cb-8a63-78f1-76144718c8c1",
    "build": "https://api.gameconductor.net/v1/builds/01774da2-a5e1-7cd2-4c63-fe610937db47"
  }
}