Method: achievements.reveal
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
針對目前驗證的玩家,將包含指定 ID 的成就狀態設為 REVEALED
。
HTTP 要求
POST https://games.googleapis.com/games/v1/achievements/{achievementId}/reveal
路徑參數
參數 |
achievementId |
string
這個方法使用的成就 ID。
|
回應主體
成就顯示回應
如果成功,回應主體會含有以下結構的資料:
欄位 |
kind |
string
專門用於識別這項資源的類型。值一律為固定字串 games#achievementRevealResponse 。
|
currentState |
enum (RevealAchievementState )
嘗試揭露的成就目前的狀態。如果成就已解鎖,則可能是 UNLOCKED 。
|
授權範圍
需要下列其中一種 OAuth 範圍:
https://www.googleapis.com/auth/games
https://www.googleapis.com/auth/games_lite
詳情請參閱 OAuth 2.0 總覽。
RevealAchievementState
列舉 |
REVEALED |
成就顯示。 |
UNLOCKED |
成就已解鎖。 |
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[null,null,["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Method: achievements.reveal\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.RevealAchievementResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [RevealAchievementState](#RevealAchievementState)\n- [Try it!](#try-it)\n\nSets the state of the achievement with the given ID to `REVEALED` for the currently authenticated player.\n\n### HTTP request\n\n`POST https://games.googleapis.com/games/v1/achievements/{achievementId}/reveal`\n\n### Path parameters\n\n| Parameters ||\n|-----------------|---------------------------------------------------------|\n| `achievementId` | `string` The ID of the achievement used by this method. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nAn achievement reveal response\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"kind\": string, \"currentState\": enum (/games/services/web/api/rest/v1/achievements/reveal#RevealAchievementState) } ``` |\n\n| Fields ||\n|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `kind` | `string` Uniquely identifies the type of this resource. Value is always the fixed string `games#achievementRevealResponse`. |\n| `currentState` | `enum (`[RevealAchievementState](/games/services/web/api/rest/v1/achievements/reveal#RevealAchievementState)`)` The current state of the achievement for which a reveal was attempted. This might be `UNLOCKED` if the achievement was already unlocked. |\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).\n\nRevealAchievementState\n----------------------\n\nPossible reveal achievement states.\n\n| Enums ||\n|------------|--------------------------|\n| `REVEALED` | Achievement is revealed. |\n| `UNLOCKED` | Achievement is unlocked. |"]]