The /game/loadturn API call is used to get the turn file from a specific game/turn/empire.
This API call may, or may not, require an apikey, depending on whether or not the game has completed.
Data | Description |
---|---|
gameid | Game ID number |
playerid | Player slot number - defaults to current account's ID in active games (that have not already been completed) |
turn | Turn number - This defaults to the last turn. |
apikey | Requester's API Key, as received from the /account/login API. This is required for active games |
forsave | Boolean - Used to determine whether changes should be save-able |
If successful, this call returns the following data:
Data | Description |
---|---|
success | True |
canmessage | Boolean - Determines whether the active player is permitted to send messages |
activity | Object - Contains the game's activity feed |
rst |
Object - Contains the turn
result's contents |
accountsettings | Object - Contains the account's active settings |
savekey | String - Key used to save turn changes |
ispremium | Boolean - Determines whether the active player has an active premium membership |
{"success":false,"error":"An API error has occurred - Object reference not set to an instance of an object. at PlanetsAPI.GameActions.LoadHistory(Game game, Player player, Boolean ispremium, AccountSettings accountSettings, Int32 turn) in C:\dev\PlanetsAPI\GameActions.cs:line 424 at PlanetsAPI.GameActions.LoadTurnNew(HttpRequest request) in C:\dev\PlanetsAPI\GameActions.cs:line 323 at PlanetsAPI.API.ProcessRequest(HttpContext context) in C:\dev\PlanetsAPI\API.cs:line 175"}
{"success":false,"error":"You do not have permission to view this turn."}