Submits a score to the specified leaderboard. Try it now.
Request
HTTP request
POST https://www.googleapis.com/games/v1/leaderboards/leaderboardId/scores
Parameters
Parameter name | Value | Description |
---|---|---|
Path parameters | ||
leaderboardId |
string |
The ID of the leaderboard. |
Required query parameters | ||
score |
long |
The score you're submitting. The submitted score is ignored if it is worse than a previously submitted score, where worse depends on the leaderboard sort order. The meaning of the score value depends on the leaderboard format type. For fixed-point, the score represents the raw value. For time, the score represents elapsed time in milliseconds. For currency, the score represents a value in micro units. |
Optional query parameters | ||
language |
string |
The preferred language to use for strings returned by this method. |
scoreTag |
string |
Additional information about the score you're submitting. Values must contain no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986. |
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
Do not supply a request body with this method.
Response
If successful, this method returns a response body with the following structure:
{ "kind": "games#playerScoreResponse", "beatenScoreTimeSpans": [ string ], "unbeatenScores": [ { "kind": "games#playerScore", "timeSpan": string, "score": long, "formattedScore": string, "scoreTag": string } ], "formattedScore": string, "leaderboardId": string, "scoreTag": string }
Property name | Value | Description | Notes |
---|---|---|---|
kind |
string |
Uniquely identifies the type of this resource. Value is always the fixed string games#playerScoreResponse . |
|
beatenScoreTimeSpans[] |
list |
The time spans where the submitted score is better than the existing score for that time span. Possible values are:
|
|
unbeatenScores[] |
list |
The scores in time spans that have not been beaten. As an example, the submitted score may be better than the player's DAILY score, but not better than the player's scores for the WEEKLY or ALL_TIME time spans. |
|
unbeatenScores[].kind |
string |
Uniquely identifies the type of this resource. Value is always the fixed string games#playerScore . |
|
unbeatenScores[].timeSpan |
string |
The time span for this player score. Possible values are:
Acceptable values are:
|
|
unbeatenScores[].score |
long |
The numerical value for this player score. | |
unbeatenScores[].formattedScore |
string |
The formatted score for this player score. | |
unbeatenScores[].scoreTag |
string |
Additional information about this score. Values will contain no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986. | |
formattedScore |
string |
The formatted value of the submitted score. | |
leaderboardId |
string |
The leaderboard ID that this score was submitted to. | |
scoreTag |
string |
Additional information about this score. Values will contain no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986. |
Try it!
Use the APIs Explorer below to call this method on live data and see the response.