Games Host
Resource Group ¶
Authentication ¶
Authentication management resource
Headers
Content-Type: application/jsonBody
{
"grant_type": "password",
"scope": "*",
"username": "john@doe.com",
"password": "secret",
"client_id": 5,
"client_secret": "xxx"
}Headers
Content-Type: application/jsonBody
{
"token_type": "Bearer",
"expired_in": 31536000,
"access_token": "xxx",
"refresh_token": "xxx"
}Headers
Content-Type: application/jsonBody
{
"message": "Unauthorized",
"status_code": 401
}Authenticates a userPOST/auth/token
Authenticates a user and returns an Access Token, that should
be sent along any restricted endpoints in the Authorization header.
Headers
Content-Type: application/jsonHeaders
Content-Type: application/jsonHeaders
Content-Type: application/jsonBody
{
"message": "Unauthorized",
"status_code": 401
}Revokes a user token accessDELETE/auth/token
Revokes the user token access
User ¶
User management resource
Headers
Content-Type: application/json
Authorization: Bearer AccessTokenHeaders
Content-Type: application/jsonBody
{
"user": {
"id": 10,
"email": "john@doe.com",
"created_at": "2017-02-27 16:48:21"
}
}Headers
Content-Type: application/jsonBody
{
"message": "Unauthorized",
"status_code": 401
}Show userGET/user
Get a JSON representation of the current authenticated user.
Headers
Content-Type: application/jsonBody
{
"username": "john@doe.com",
"password": "secret",
"client_id": 5,
"client_secret": "xxxx"
}Headers
Content-Type: application/json
Location: /userHeaders
Content-Type: application/jsonBody
{
"message": "Unauthorized",
"status_code": 401
}Headers
Content-Type: application/jsonBody
{
"message": "Could not create new user.",
"status_code": 422,
"errors": {
"username": "The username field is required."
}
}Create userPOST/user
Creates a new user and returns its JSON representation.
User's GameServers ¶
User’s game servers management resource
Headers
Content-Type: application/json
Authorization: Bearer AccessTokenHeaders
Content-Type: application/jsonBody
[
{
"id": 8,
"user_id": 8,
"game_id": 1,
"host_server_id": 1,
"installed": 2,
"created_at": "2017-03-02 20:33:44",
"updated_at": "2017-03-02 20:33:44",
"game": {
"id": 1,
"name": "Counter Strike : Source",
"short_name": "css",
"minplayers": 25,
"maxplayers": 64,
"cents_per_slots": 20
},
"hostserver": {
"id": 1,
"name": "Cthulhu"
}
}
]Headers
Content-Type: application/jsonBody
{
"message": "Unauthorized",
"status_code": 401
}Show the user's game servers listGET/user/gameservers
Get a JSON representation of the list of game servers owned by the user.
Headers
Content-Type: application/json
Authorization: Bearer AccessTokenHeaders
Content-Type: application/jsonBody
{
"game_server": {
"id": 1,
"user_id": 1,
"game_id": 1,
"host_server_id": 1,
"installed": 2,
"created_at": "2017-03-02 20:56:27",
"updated_at": "2017-03-02 20:56:27",
"game": {
"id": 1,
"name": "Counter Strike : Source",
"short_name": "css",
"minplayers": 16,
"maxplayers": 54,
"cents_per_slots": 34
},
"hostserver": {
"id": 1,
"name": "Cthulhu"
}
}
}Headers
Content-Type: application/jsonBody
{
"message": "Unauthorized",
"status_code": 401
}Headers
Content-Type: application/jsonBody
{
"message": "Resource Not Found",
"status_code": 404
}Show a user's game serverGET/user/gameservers/{id}
Get a JSON representation of a user’s game server represented by id.
The user needs to own the game server to access this endpoint
- id
integer(required)The ID of the game server.
Headers
Content-Type: application/json
Authorization: Bearer AccessTokenHeaders
Content-Type: application/jsonHeaders
Content-Type: application/jsonBody
{
"message": "Unauthorized",
"status_code": 401
}Headers
Content-Type: application/jsonBody
{
"message": "Resource Not Found",
"status_code": 404
}Start a user's game serverGET/user/gameservers/{id}/start
Will start a user’s game server.
The user needs to own the game server to access this endpoint
- id
integer(required)The ID of the game server.
Headers
Content-Type: application/json
Authorization: Bearer AccessTokenHeaders
Content-Type: application/jsonHeaders
Content-Type: application/jsonBody
{
"message": "Unauthorized",
"status_code": 401
}Headers
Content-Type: application/jsonBody
{
"message": "Resource Not Found",
"status_code": 404
}Stop a user's game serverGET/user/gameservers/{id}/stop
Will stop a user’s game server.
The user needs to own the game server to access this endpoint
- id
integer(required)The ID of the game server.
Headers
Content-Type: application/json
Authorization: Bearer AccessTokenHeaders
Content-Type: application/jsonHeaders
Content-Type: application/jsonBody
{
"message": "Unauthorized",
"status_code": 401
}Headers
Content-Type: application/jsonBody
{
"message": "Resource Not Found",
"status_code": 404
}Restart a user's game serverGET/user/gameservers/{id}/restart
Will restart a user’s game server.
The user needs to own the game server to access this endpoint
- id
integer(required)The ID of the game server.
HostServer ¶
HostServer management resource - A host server is the remote server that will host game servers.
Headers
Content-Type: application/json
Authorization: Bearer AccessTokenHeaders
Content-Type: application/jsonBody
[
{
"id": 10,
"name": "Cthulhu",
"auth_info": {
"key": "",
"host": "127.0.0.1:22",
"agent": "",
"keytext": "",
"password": "",
"username": "root",
"keyphrase": ""
}
}
]Headers
Content-Type: application/jsonBody
{
"message": "Unauthorized",
"status_code": 401
}Show the host servers listGET/hostservers
Get a JSON representation of all host servers.
The user needs to be an administrator to access this endpoint
Headers
Content-Type: application/json
Authorization: Bearer AccessTokenHeaders
Content-Type: application/jsonBody
{
"host_server": {
"id": 1,
"name": "Cthulhu",
"auth_info": {
"key": "",
"host": "127.0.0.1:22",
"agent": "",
"keytext": "",
"password": "",
"username": "root",
"keyphrase": ""
}
}
}Headers
Content-Type: application/jsonBody
{
"message": "Unauthorized",
"status_code": 401
}Headers
Content-Type: application/jsonBody
{
"message": "Resource Not Found",
"status_code": 404
}Show host serverGET/hostservers/{id}
Get a JSON representation of a host server represented by id.
The user needs to be an administrator to access this endpoint
- id
integer(required)The ID of the hostserver.
Game ¶
Game management resource
Headers
Content-Type: application/jsonBody
[
{
"id": 10,
"name": "Counter Strike Source",
"shortname": "css",
"minplayers": 5,
"maxplayers": 64,
"cents_per_slots": 25
}
]Show the games listGET/games
Get a JSON representation of all available games.
Headers
Content-Type: application/jsonBody
{
"game": {
"id": 10,
"name": "Counter Strike Source",
"shortname": "css",
"minplayers": 5,
"maxplayers": 64,
"cents_per_slots": 25
}
}Headers
Content-Type: application/jsonBody
{
"message": "Resource Not Found",
"status_code": 404
}Show a gameGET/games/{id}
Get a JSON representation of a game represented by id.
- id
integer(required)The ID of the game.
Generated by aglio on 02 Mar 2017