Skip to content

/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.

FieldTypeRequiredDescriptionExample
idstringNoThe 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"
locationstringYesThe location or region that the game session is preferred to be hosted in."europe"
imagestringYesThe name of the image of the game to host inside a container."nginx"
envmapNoThe list of environment variables to feed the container on startup."{\"env\":{\"my-secret\":\"<some_very_secret_value>\"}}"
argsarrayNoThe list of program console arguments to feed to the application hosted inside the underlying container."[\"--max-players=8\",\"--match-type=quick-play\"]"
restartbooleanNoIndicates whether this session must be automatically restarted on failure. The underlying container will not be restarted in case of a manual termination.false
labelsmapNoThe collection of user-defined key/value metadata stored inside the configuration of the session."{\"labels\":{\"my-example-tag\":\"1\",\"another-example-tag\":\"3\"}}"
versionstringNoTag 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.""
cURL
curl --location 'https://api.sandbox-gameye.gameye.net/session' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"location": "europe",
"image": "nginx"
}'
javascript
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));
Ruby
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_body
Python
import requests
import 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)

A session has successfully been started on a machine in the provided location.

FieldTypeRequired
idstringNo
hoststringYes
portsarrayYes
// 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.

FieldTypeRequired
statusCodeintegerYes
codestringYes
messagestringYes
detailsstringYes
pathstringYes
timestampstringYes
identifierstringYes
violationsarrayNo
// You are not authorized to start a session. Please make sure that the included bearer
token 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.

FieldTypeRequired
statusCodeintegerYes
codestringYes
messagestringYes
detailsstringYes
pathstringYes
timestampstringYes
identifierstringYes
violationsarrayNo
// 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.

FieldTypeRequired
statusCodeintegerYes
codestringYes
messagestringYes
detailsstringYes
pathstringYes
timestampstringYes
identifierstringYes
violationsarrayNo
// Cannot start a session with the provided id. Please use a unique identifier
for 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!

FieldTypeRequired
statusCodeintegerYes
codestringYes
messagestringYes
detailsstringYes
pathstringYes
timestampstringYes
identifierstringYes
violationsarrayNo
// 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.

FieldTypeRequired
statusCodeintegerYes
codestringYes
messagestringYes
detailsstringYes
pathstringYes
timestampstringYes
identifierstringYes
violationsarrayNo
// Bad request. This may imply that the given request has invalid syntax.
{
"statusCode": 0,
"code": "",
"message": "",
"details": "",
"path": "",
"timestamp": "",
"identifier": "",
"violations": [
{
"field": "",
"description": ""
}
]
}