REST API

Last updated 20 days ago

API Call Result Values

All API calls return a string Result value as the first field in the returned data. Possible values are:

Result

Description

SUCCESS

CALL_ALREADY_IN_PROCESS

WAITING_FOR_GAME

GAME_ALREADY_STARTED

GAME_HAS_ENDED

INVALID_LOGIN_OR_PASSWORD

INVALID_PLAYER_KEY

BOT_IS_SUSPENDED

BOT_IS_INACTIVE

INSUFFICIENT_BALANCE

NOT_YOUR_MOVE

INVALID_MOVE

GameStatus Values

Value

Description

STARTING_SOON

Game will start shortly

RUNNING

Game is in progress

WON

Game is over and this client won

WON_BY_TIMEOUT

This client won by the other player timing out

LOST

This client lost

LOST_BY_TIMEOUT

This client lost by timing out

DRAWN

The game ended in a draw

Schema

All API access is over HTTPS, and accessed through:

https://19y3lnjoy9.execute-api.eu-west-2.amazonaws.com

All data is sent and received as JSON.

post
Get List Of Game Styles

/prod/GM-GetListOfGameStyles
Gets a list of all game styles that are available for the given game type.
Request
Response
Path Parameters
BotId
required
string
BotPassword
required
string
GameTypeId
required
integer
200: OK
{
"Result": "See List Of Result Values",
"GameStyles": [
{
"GameStyleId": 99,
"GameType": 99,
"Stake": 99,
"Prize": 99,
"GameTypeSpecificInfo":
}
],
"Balance": 99
}

post
Offer Game

/prod/GM-OfferGame
This allows the user to offer to play a game. Either a game will start immediately if there is a suitable opponent waiting to play, or, the game offer will be queued on the server to wait for an opponent and the client informed.
Request
Response
Body Parameters
BotId
required
string
BotPassword
required
string
MaximumWaitTime
required
integer
GameStyleId
required
integer
DontPlayAgainstSameUser
required
boolean
DontPlayAgainstSameBot
required
boolean
OpponenetId
required
string
200: OK
{
"Result": "See List Of Result Values",
"GameState": [GameType specific JSON describing the current state of the game],
"PlayerKey": "key",
GameId: 99
}

post
Cancel Game Offer

/prod/GM-CancelGameOffer
Request
Response
Path Parameters
BotId
required
string
BotPassword
required
string
PlayerKey
required
string
200: OK
{
"Result": "See List Of Result Values",
"GameState": [GameType specific JSON describing the current state of the game],
}

post
Poll For Game State

/prod/GM-PollForGameState
Request
Response
Path Parameters
BotId
required
string
BotPassword
required
string
PlayerKey
required
string
200: OK
{
"Result": "See List Of Result Values",
"GameState": [GameType specific JSON describing the current state of the game],
}

post
Make Move

/prod/GM-MakeMove
Request
Response
Path Parameters
BotId
required
string
BotPassword
required
string
PlayerKey
required
string
Move
required
object
MoveType format is specific to the game type that is being played.
200: OK
{
"Result": "See List Of Result Values",
"GameState": [GameType specific JSON describing the current state of the game],
}

Test the API with Postman

You can try out the API using the handy Postman app for Chrome - use this link:

https://www.getpostman.com/apps

Demo API Program

We have created a complete GUI app in Python that uses the REST API to play games on our site. This provides a great example of how each REST API call should be implemented.

You can find out more details about this and how to download it on our Test harness using the REST API page.