Method: scores.submit
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
HTTP 请求
POST https://games.googleapis.com/games/v1/leaderboards/{leaderboardId}/scores
路径参数
参数 |
leaderboardId |
string
排行榜的 ID。
|
查询参数
参数 |
language |
string
此方法返回的字符串的首选语言。
|
score |
string (int64 format)
必需。您要提交的分数。如果提交的得分低于之前提交的得分,系统会忽略该得分,其中“低于”取决于排行榜的排序方式。得分值的含义取决于排行榜格式类型。对于固定点,得分表示原始值。对于时间,得分表示经过的时间(以毫秒为单位)。对于货币,得分表示以微单位表示的值。
|
scoreTag |
string
有关您要提交的评分的更多信息。值不得超过 64 个 URI 安全字符(如 RFC 3986 的第 2.3 节所定义)。
|
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/games
https://www.googleapis.com/auth/games_lite
如需了解详情,请参阅 OAuth 2.0 概览。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Method: scores.submit\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nSubmits a score to the specified leaderboard.\n\n### HTTP request\n\n`POST https://games.googleapis.com/games/v1/leaderboards/{leaderboardId}/scores`\n\n### Path parameters\n\n| Parameters ||\n|-----------------|-------------------------------------|\n| `leaderboardId` | `string` The ID of the leaderboard. |\n\n### Query parameters\n\n| Parameters ||\n|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `language` | `string` The preferred language to use for strings returned by this method. |\n| `score` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` Required. 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. |\n| `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. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains an instance of [SubmitLeaderboardScoreResponse](/games/services/web/api/rest/v1/SubmitLeaderboardScoreResponse).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/games`\n- `\n https://www.googleapis.com/auth/games_lite`\n\nFor more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2)."]]