Documentation

StartGame

Instructs the PlayFab game server hosting service to instantiate a new Game Server Instance

Request Details

StartGameRequest
Request Properties
Build (required) String

Unique identifier of the previously uploaded build executable which is to be started.

CustomCommandLineData String

Custom command line argument when starting game server process.

ExternalMatchmakerEventEndpoint (required) String

HTTP endpoint URL for receiving game status events, if using an external matchmaker. When the game ends, PlayFab will make a POST request to this URL with the X-SecretKey header set to the value of the game's secret and an application/json body of { "EventName": "game_ended", "GameID": "" }.

GameMode (required) String

Game mode for this Game Server Instance.

Region (required) Region

Region with which to associate the server, for filtering.

POST https://{{TitleID}}.playfabapi.com/Matchmaker/StartGame
    Content-Type: application/json
    X-SecretKey: <developer_secret_key>
{
  "Build": "6.01",
  "Region": "USCentral",
  "GameMode": "capture_the_flag",
  "CustomCommandLineData": "custom_gameserver_commandline_parameter",
  "ExternalMatchmakerEventEndpoint": "https://yourmatchmaker.com/gamestatusevents/"
}
        

Response Details

StartGameResponse
Result Properties
GameID String

Unique identifier for the game/lobby in the new Game Server Instance.

ServerIPV4Address String

IPV4 address of the server

ServerIPV6Address String

IPV6 address of the new Game Server Instance.

ServerPort (required) uint32

Port number for communication with the Game Server Instance.

ServerPublicDNSName String

Public DNS name (if any) of the server

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "GameID": "1913398545777970887",
    "ServerHostname": "14.57.243.85",
    "ServerIPV6Address": "2600:1f18:70d:5100:8949:a309:976a:e6fa",
    "ServerPort": 1200
  }
}

Authentication

SecretKey

Possible Error Codes

Name Code
BuildNotFound 1032
InvalidParams 1000