/session
POST https://api.sandbox-gameye.gameye.net/session
Section titled “POST https://api.sandbox-gameye.gameye.net/session”Allocate a new game session in a specific region. Each session is to be identified by a unique identifier that is provided by the caller. It is recommended to use a UUID.
Request Body
Section titled “Request Body”| Field | Type | Required | Description | Example |
|---|---|---|---|---|
id | string | No | The unique identifier of the session. If undefined, Gameye will generate a UUIDV4 for you and return it in the API response. | "f7965a22-e327-4541-a30e-8262890d3a29" |
location | string | Yes | The location or region that the game session is preferred to be hosted in. | "europe" |
image | string | Yes | The name of the image of the game to host inside a container. | "nginx" |
env | map | No | The list of environment variables to feed the container on startup. | "{\"env\":{\"my-secret\":\"<some_very_secret_value>\"}}" |
args | array | No | The list of program console arguments to feed to the application hosted inside the underlying container. | "[\"--max-players=8\",\"--match-type=quick-play\"]" |
restart | boolean | No | Indicates whether this session must be automatically restarted on failure. The underlying container will not be restarted in case of a manual termination. | false |
labels | map | No | The collection of user-defined key/value metadata stored inside the configuration of the session. | "{\"labels\":{\"my-example-tag\":\"1\",\"another-example-tag\":\"3\"}}" |
version | string | No | Tag of the image that the session will be run. This tag needs to be available or a 404 will be thrown. If not specified run the tag with the highest priority. | "" |
Code Examples
Section titled “Code Examples”curl --location 'https://api.sandbox-gameye.gameye.net/session' \--header 'Accept: application/json' \--header 'Content-Type: application/json' \--data '{ "location": "europe", "image": "nginx"}'var myHeaders = new Headers();myHeaders.append("Accept", "application/json");myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({ "location": "europe", "image": "nginx"});
var requestOptions = { method: 'POST', headers: myHeaders, body: raw, redirect: 'follow'};
fetch("https://api.sandbox-gameye.gameye.net/session", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));require "uri"require "json"require "net/http"
url = URI("https://api.sandbox-gameye.gameye.net/session")
https = Net::HTTP.new(url.host, url.port)https.use_ssl = true
request = Net::HTTP::Post.new(url)request["Accept"] = "application/json"request["Content-Type"] = "application/json"request.body = JSON.dump({ "location": "europe", "image": "nginx"})
response = https.request(request)puts response.read_bodyimport requestsimport json
url = "https://api.sandbox-gameye.gameye.net/session"
payload = json.dumps({ "location": "europe", "image": "nginx"})headers = { 'Accept': 'application/json', 'Content-Type': 'application/json'}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)Responses
Section titled “Responses”A session has successfully been started on a machine in the provided location.
| Field | Type | Required |
|---|---|---|
id | string | No |
host | string | Yes |
ports | array | Yes |
// A session has successfully been started on a machine in the provided location.
{ "id": "", "host": "", "ports": [ { "type": "", "container": 0, "host": 0 } ]}You are not authorized to start a session. Please make sure that the included bearer token is correct.
| Field | Type | Required |
|---|---|---|
statusCode | integer | Yes |
code | string | Yes |
message | string | Yes |
details | string | Yes |
path | string | Yes |
timestamp | string | Yes |
identifier | string | Yes |
violations | array | No |
// You are not authorized to start a session. Please make sure that the included bearertoken is correct.
{ "statusCode": 0, "code": "", "message": "", "details": "", "path": "", "timestamp": "", "identifier": "", "violations": [ { "field": "", "description": "" } ]}The request contains a location, image or organization that does not exist.
| Field | Type | Required |
|---|---|---|
statusCode | integer | Yes |
code | string | Yes |
message | string | Yes |
details | string | Yes |
path | string | Yes |
timestamp | string | Yes |
identifier | string | Yes |
violations | array | No |
// The request contains a location, image or organization that does not exist.
{ "statusCode": 0, "code": "", "message": "", "details": "", "path": "", "timestamp": "", "identifier": "", "violations": [ { "field": "", "description": "" } ]}Cannot start a session with the provided id. Please use a unique identifier for your session. It is recommended to use a UUID.
| Field | Type | Required |
|---|---|---|
statusCode | integer | Yes |
code | string | Yes |
message | string | Yes |
details | string | Yes |
path | string | Yes |
timestamp | string | Yes |
identifier | string | Yes |
violations | array | No |
// Cannot start a session with the provided id. Please use a unique identifierfor your session. It is recommended to use a UUID.
{ "statusCode": 0, "code": "", "message": "", "details": "", "path": "", "timestamp": "", "identifier": "", "violations": [ { "field": "", "description": "" } ]}This session can not be started in the provided location currently. This could also be the result of starting too many sessions in a short period of time. Please try again later!
| Field | Type | Required |
|---|---|---|
statusCode | integer | Yes |
code | string | Yes |
message | string | Yes |
details | string | Yes |
path | string | Yes |
timestamp | string | Yes |
identifier | string | Yes |
violations | array | No |
// This session can not be started in the provided location currently. This could also be the result of starting too many sessions in a short period of time. Please try again later!
{ "statusCode": 0, "code": "", "message": "", "details": "", "path": "", "timestamp": "", "identifier": "", "violations": [ { "field": "", "description": "" } ]}Bad request. This may imply that the given request has invalid syntax.
| Field | Type | Required |
|---|---|---|
statusCode | integer | Yes |
code | string | Yes |
message | string | Yes |
details | string | Yes |
path | string | Yes |
timestamp | string | Yes |
identifier | string | Yes |
violations | array | No |
// Bad request. This may imply that the given request has invalid syntax.
{ "statusCode": 0, "code": "", "message": "", "details": "", "path": "", "timestamp": "", "identifier": "", "violations": [ { "field": "", "description": "" } ]}