API Methods
[GET]http://multiplayerrobot.com/api/Diplomacy/AuthenticateUser?authKey=[user authKey]
Parameters:
- authKey - The authentication key for the user as found on the Download page after they login to GMR
Returns: A 64-bit integer representing the user's PlayerId if success, null or empty if failure
Sample Request: http://multiplayerrobot.com/api/Diplomacy/AuthenticateUser?authKey=XI2N29D0JKD10
Sample Response: 76561198007962530
Notes: Use this method to verify if an Authentication Key you've been given by the user is valid on GMR. Thus you really only need to call it once per application lifetime.
↑ GetGamesAndPlayers
[GET]http://multiplayerrobot.com/api/Diplomacy/GetGamesAndPlayers?playerIDText=[playerId1_playerId2_playerId3...]&authKey=[user authKey]
Parameters:
- playerIDText - A list of GMR PlayerIds to query, seperated with an underscore
- authKey - The authentication key for the user as found on the Download page after they login to GMR
Returns: XML or JSON serialized complex type:
"GamesAndPlayers" : {
"Games" : [{"Name":<game's name>,
"GameId":<game's ID>,
"Players":[{"UserId":<player's ID>, "TurnOrder":<player's position in game>}, ...],
"CurrentTurn":{"TurnId":<turn's ID>,
"Number":<this turn number in game>,
"UserId":<current player ID>,
"Started":<date and time turn started>,
"Expires":<date and time turn expires>,
"PlayerNumber":<current player sequence in game>,
"IsFirstTurn":<whether it's the first turn in game>}
}, ...],
"Players" : [{"SteamID":<same as PlayerId and UserId>,
"PersonaName":<player's name>,
"AvatarUrl":<URL to player's avatar>,
"PersonaState":<player's steam status>,
"GameID":<steam ID of game user is currently playing>
}, ...],
"CurrentTotalPoints" : <users total points>
}
Sample Request: http://multiplayerrobot.com/api/Diplomacy/GetGamesAndPlayers?playerIDText=76561198083415130_76561198044733382&authKey=XI2N29D0JKD10
Sample Response:
{"Games":[{"Name":"SMASHER3000", "GameId":3328, "Players":[{"UserId":76561198083415130, "TurnOrder":4}, {"UserId":76561198044733382,"TurnOrder":0}, {"UserId":76561198027844720,"TurnOrder":1}, {"UserId":76561197970797348,"TurnOrder":2}, {"UserId":76561198082609496,"TurnOrder":3}, {"UserId":0,"TurnOrder":5}, {"UserId":0,"TurnOrder":6}, {"UserId":0,"TurnOrder":7}, {"UserId":0,"TurnOrder":8}, {"UserId":0,"TurnOrder":9}], "CurrentTurn":{"TurnId":405850,"Number":721, "UserId":76561198044733382, "Started":"2013-07-19T14:33:52.613", "Expires":"2013-07-20T14:33:52.613", "Skipped":false, "PlayerNumber":0, "IsFirstTurn":false}, "Type":0}], "Players":[{"SteamID":76561197970797348, "PersonaName":"Driblis", "AvatarUrl":"http://media.steampowered.com/steamcommunity/public/images/avatars/49/49736644b35bcc09fbe77b69e4db8c0f229df9a5.jpg", "PersonaState":0,"GameID":0}, {"SteamID":76561198027844720, "PersonaName":"Kebab", "AvatarUrl":"http://media.steampowered.com/steamcommunity/public/images/avatars/62/627702a474ba48b69092cd42719c6ab00482e086.jpg", "PersonaState":0,"GameID":0}], "CurrentTotalPoints":641}
Notes: Please don't call this more than once every 15 seconds. This is the method used to poll the server for the latest information pertitenent to the player. It returns everything you need to show the player's current list of games with the current player order, each player's avatar, name, and Steam status, and the current player's total points on GMR.
↑ GetLatestSaveFileBytes
[GET]http://multiplayerrobot.com/api/Diplomacy/GetLatestSaveFileBytes?authKey=[user authKey]&gameId=[game ID]
Parameters:
- authKey - The authentication key for the user as found on the Download page after they login to GMR
- gameId - The ID of the GMR game to download the latest save file for
Returns: The current save file as an attachment called "(GMR) Play this one!.Civ5Save"
Sample Request: http://multiplayerrobot.com/api/Diplomacy/GetLatestSaveFileBytes?authKey=XI2N29D0JKD10&gameId=3042
Sample Response: A download of all the bytes representing the save file
Notes: Use this method to get the save file for a player's turn. Note that even though the method appears to just get the latest save file for a particular game, if the provided authKey does not match that game's current player this call will return an unauthorized error.
↑ SubmitTurn
[POST]http://multiplayerrobot.com/api/Diplomacy/SubmitTurn?authKey=[user authKey]&turnId=[turn ID]
Parameters:
- authKey - The authentication key for the user as found on the Download page after they login to GMR
- gameId - The ID of the GMR turn that you're submitting a save file for
- POST Body - The raw bytes of the save file being submitted for this turn
Returns: XML or JSON serialized complex type:
"SubmitTurnResultType" : {
"ResultType" : < UnexpectedError | OK | NotTurn | DoubleSubmit >,
"PointsEarned" : <amount of points earned for this turn>
}
Sample Request: http://multiplayerrobot.com/api/Diplomacy/SubmitTurn?authKey=XI2N29D0JKD10&turnId=367583 [save file bytes in POST body]
Sample Response: {"ResultType":"OK", "PointsEarned":4}
Notes: This is the method used to submit a save file as the result of a player's turn. You need to include the the raw bytes of the save file as the content of the request, similiar to how you would upload a file in any HTTP scenario. Make sure that you include the size of the save file's bytes in the "Content-length" header of the request. We check this header to make sure that our server receives all the bytes properly.
Except Steam, which is owned by Valve Corporation
and any Civ V icons, which are owned by Firaxis Games