TurnBasedMatches: finish

Finish a turn-based match. Each player should make this call once, after all results are in. Only the player whose turn it is may make the first call to Finish, and can pass in the final match state. Try it now.

Request

HTTP request

PUT https://www.googleapis.com/games/v1/turnbasedmatches/matchId/finish

Parameters

Parameter name Value Description
Path parameters
matchId string The ID of the match.
Optional query parameters
language string The preferred language to use for strings returned by this method.

Authorization

This request requires authorization with the following scope:

Scope
https://www.googleapis.com/auth/games

For more information, see the authentication and authorization page.

Request body

In the request body, supply data with the following structure:

{
  "kind": "games#turnBasedMatchResults",
  "results": [
    {
      "kind": "games#participantResult",
      "participantId": string,
      "result": string,
      "placing": integer
    }
  ],
  "data": {
    "kind": "games#turnBasedMatchDataRequest",
    "data": bytes
  },
  "matchVersion": integer
}
Property name Value Description Notes
kind string Uniquely identifies the type of this resource. Value is always the fixed string games#turnBasedMatchResults.
results[] list The match results for the participants in the match.
results[].kind string Uniquely identifies the type of this resource. Value is always the fixed string games#participantResult.
results[].participantId string The ID of the participant.
results[].result string The result of the participant for this match.
Possible values are:
  • "MATCH_RESULT_WIN" - The participant won the match.
  • "MATCH_RESULT_LOSS" - The participant lost the match.
  • "MATCH_RESULT_TIE" - The participant tied the match.
  • "MATCH_RESULT_NONE" - There was no winner for the match (nobody wins or loses this kind of game.)
  • "MATCH_RESULT_DISCONNECT" - The participant disconnected / left during the match.
  • "MATCH_RESULT_DISAGREED" - Different clients reported different results for this participant.


Acceptable values are:
  • "MATCH_RESULT_DISAGREED"
  • "MATCH_RESULT_DISCONNECT"
  • "MATCH_RESULT_LOSS"
  • "MATCH_RESULT_NONE"
  • "MATCH_RESULT_TIE"
  • "MATCH_RESULT_WIN"
results[].placing integer The placement or ranking of the participant in the match results; a number from one to the number of participants in the match. Multiple participants may have the same placing value in case of a type.
data nested object The final match data.
data.kind string Uniquely identifies the type of this resource. Value is always the fixed string games#turnBasedMatchDataRequest.
data.data bytes The byte representation of the data (limited to 128 kB), as a Base64-encoded string with the URL_SAFE encoding option.
matchVersion integer The version of the match being updated.

Response

If successful, this method returns a TurnBasedMatches resource in the response body.

Try it!

Use the APIs Explorer below to call this method on live data and see the response.