POST game/host

Host a new multiplayer game.

Example

POST /api/v1/game/host HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer ...

{
  "playId": "bfba9f87-c805-4f13-8e60-77d2473e4867",
  "name": "Would you like to play a game?",
  "maxPlayers": 8,
  "settings": {
    "map": "2fort5",
    "health": 1.5,
    "bestOf": 3
  }
}
----------------------------------------
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "instanceId": "a2c4f9bd-b698-4b21-839d-81e75e514d0c",
  "gameId": "a2c4f9bd-b698-4b21-839d-81e75e514d0c",
  "socketUrl": "wss://ws1.theendlessmission.com/game/a2c4f9bd-b698-4b21-839d-81e75e514d0c",
  "accessToken": "eyJhb...Qjg"
}

Security

Authentication is required.

URL Parameters

NONE

Query Parameters

NONE

Request Body

NameDescriptionValue
playIdthe ID of the game being played on this instance; it may be a UUID of an entity (by reivision), or it may be another identifier known by the game client.NOTE: this field is currently optional during an introductory period. If not given, playId will be stored as the empty string.string
namethe display name for this multiplayer game in listingsstring
maxPlayersthe number of players that can joinnumber
settingsa game-type-specific bag of settings, to be given to a player joining the game; no schema is enforced on these settings optionalThis may be the basis of fine-grained search and sort in future.object

Response

Successful responses are code 200 with data in the response body. Other error responses are standard.

Response Body

NameDescriptionValue
intanceIdthe ID of the game that was createdstring
gameIdthe ID of the game that was created. NOTE: this field is deprecated and will be removed. Use instanceId instead.string
socketUrlthe URL to use to establish a WebSocket connectionstring
accessTokena token granting access to the socket host, as a JWTstring