Method: achievements.increment
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
为当前已通过身份验证的玩家递增具有给定 ID 的成就的步数。
HTTP 请求
POST https://games.googleapis.com/games/v1/achievements/{achievementId}/increment
路径参数
参数 |
achievementId |
string
此方法使用的成就的 ID。
|
查询参数
参数 |
requestId |
string (int64 format)
为调用方指定的每个请求随机生成的数字 ID。服务器会使用此编号,以确保在多次重试后正确处理请求。
|
stepsToIncrement |
integer
必需。要递增的步数。
|
响应正文
成就递增响应
如果成功,响应正文将包含结构如下的数据:
JSON 表示法 |
{
"kind": string,
"currentSteps": integer,
"newlyUnlocked": boolean
} |
字段 |
kind |
string
唯一标识此资源的类型。值始终为固定字符串 games#achievementIncrementResponse 。
|
currentSteps |
integer
为此分步成就记录的当前步骤。
|
newlyUnlocked |
boolean
成就的当前步骤数是否已达到解锁所需的步骤数。
|
授权范围
需要以下 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: achievements.increment\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 - [JSON representation](#body.IncrementAchievementResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nIncrements the steps of the achievement with the given ID for the currently authenticated player.\n\n### HTTP request\n\n`POST https://games.googleapis.com/games/v1/achievements/{achievementId}/increment`\n\n### Path parameters\n\n| Parameters ||\n|-----------------|---------------------------------------------------------|\n| `achievementId` | `string` The ID of the achievement used by this method. |\n\n### Query parameters\n\n| Parameters ||\n|--------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `requestId` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` A randomly generated numeric ID for each request specified by the caller. This number is used at the server to ensure that the request is handled correctly across retries. |\n| `stepsToIncrement` | `integer` Required. The number of steps to increment. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nAn achievement increment response\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------|\n| ``` { \"kind\": string, \"currentSteps\": integer, \"newlyUnlocked\": boolean } ``` |\n\n| Fields ||\n|-----------------|--------------------------------------------------------------------------------------------------------------------------------|\n| `kind` | `string` Uniquely identifies the type of this resource. Value is always the fixed string `games#achievementIncrementResponse`. |\n| `currentSteps` | `integer` The current steps recorded for this incremental achievement. |\n| `newlyUnlocked` | `boolean` Whether the current steps for the achievement has reached the number of steps required to unlock. |\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)."]]