Method: achievements.increment
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
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 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[null,null,["上次更新時間: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)."]]