Method: achievements.list
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
HTTP 要求
GET https://games.googleapis.com/games/v1/players/{playerId}/achievements
路徑參數
參數 |
playerId |
string
玩家 ID。您可以使用 me 值取代已驗證玩家的 ID。
|
查詢參數
參數 |
language |
string
此方法傳回字串的偏好語言。
|
maxResults |
integer
回應中要傳回的成就資源數量上限,用於分頁。針對任何回應,傳回的成就資源數量可能少於指定的 maxResults 。
|
pageToken |
string
先前要求傳回的權杖。
|
state |
enum (State )
指示伺服器只傳回特定狀態的成就。如未指定這個參數,系統會傳回所有成就。
|
回應主體
成就物件清單。
如果成功,回應主體會含有以下結構的資料:
JSON 表示法 |
{
"kind": string,
"nextPageToken": string,
"items": [
{
object (PlayerAchievement )
}
]
} |
欄位 |
kind |
string
專門用於識別這項資源的類型。值一律為固定字串 games#playerAchievementListResponse 。
|
nextPageToken |
string
與結果下一頁相對應的權杖。
|
items[] |
object (PlayerAchievement )
成就。
|
授權範圍
需要下列其中一種 OAuth 範圍:
https://www.googleapis.com/auth/games
https://www.googleapis.com/auth/games_lite
詳情請參閱 OAuth 2.0 總覽。
州
列舉 |
ALL |
列出所有成就。此為預設值。 |
HIDDEN |
僅列出隱藏的成就。 |
REVEALED |
僅顯示顯示的成就。 |
UNLOCKED |
僅列出已解鎖的成就。 |
PlayerAchievement
JSON 表示法 |
{
"kind": string,
"id": string,
"currentSteps": integer,
"formattedCurrentStepsString": string,
"achievementState": enum (State ),
"lastUpdatedTimestamp": string,
"experiencePoints": string
} |
欄位 |
kind |
string
專門用於識別這項資源的類型。值一律為固定字串 games#playerAchievement 。
|
id |
string
成就的 ID。
|
currentSteps |
integer
漸進式成就的目前步驟。
|
formattedCurrentStepsString |
string
漸進式成就的目前步驟 (以字串形式表示)。
|
achievementState |
enum (State )
成就的狀態。
|
lastUpdatedTimestamp |
string (int64 format)
此成就狀態上次修改的時間戳記。
|
experiencePoints |
string (int64 format)
達成成就的經驗值。如果成就尚未解鎖,或是測試人員已解鎖但尚未發布的成就,則不會顯示這個欄位。
|
州
列舉 |
HIDDEN |
已隱藏成就。 |
REVEALED |
成就顯示。 |
UNLOCKED |
成就已解鎖。 |
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Method: achievements.list\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.ListAchievementsResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [State](#State)\n- [PlayerAchievement](#PlayerAchievement)\n - [JSON representation](#PlayerAchievement.SCHEMA_REPRESENTATION)\n- [State](#State_1)\n- [Try it!](#try-it)\n\nLists the progress for all your application's achievements for the currently authenticated player.\n\n### HTTP request\n\n`GET https://games.googleapis.com/games/v1/players/{playerId}/achievements`\n\n### Path parameters\n\n| Parameters ||\n|------------|----------------------------------------------------------------------------------------------|\n| `playerId` | `string` A player ID. A value of `me` may be used in place of the authenticated player's ID. |\n\n### Query parameters\n\n| Parameters ||\n|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `language` | `string` The preferred language to use for strings returned by this method. |\n| `maxResults` | `integer` The maximum number of achievement resources to return in the response, used for paging. For any response, the actual number of achievement resources returned may be less than the specified `maxResults`. |\n| `pageToken` | `string` The token returned by the previous request. |\n| `state` | `enum (`[State](/games/services/web/api/rest/v1/achievements/list#State)`)` Tells the server to return only achievements with the specified state. If this parameter isn't specified, all achievements are returned. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nA list of achievement objects.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"kind\": string, \"nextPageToken\": string, \"items\": [ { object (/games/services/web/api/rest/v1/achievements/list#PlayerAchievement) } ] } ``` |\n\n| Fields ||\n|-----------------|---------------------------------------------------------------------------------------------------------------------------------|\n| `kind` | `string` Uniquely identifies the type of this resource. Value is always the fixed string `games#playerAchievementListResponse`. |\n| `nextPageToken` | `string` Token corresponding to the next page of results. |\n| `items[]` | `object (`[PlayerAchievement](/games/services/web/api/rest/v1/achievements/list#PlayerAchievement)`)` The achievements. |\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\nState\n-----\n\n| Enums ||\n|------------|---------------------------------------------|\n| `ALL` | List all achievements. This is the default. |\n| `HIDDEN` | List only hidden achievements. |\n| `REVEALED` | List only revealed achievements. |\n| `UNLOCKED` | List only unlocked achievements. |\n\nPlayerAchievement\n-----------------\n\nAn achievement object.\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"kind\": string, \"id\": string, \"currentSteps\": integer, \"formattedCurrentStepsString\": string, \"achievementState\": enum (/games/services/web/api/rest/v1/achievements/list#State_1), \"lastUpdatedTimestamp\": string, \"experiencePoints\": string } ``` |\n\n| Fields ||\n|-------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `kind` | `string` Uniquely identifies the type of this resource. Value is always the fixed string `games#playerAchievement`. |\n| `id` | `string` The ID of the achievement. |\n| `currentSteps` | `integer` The current steps for an incremental achievement. |\n| `formattedCurrentStepsString` | `string` The current steps for an incremental achievement as a string. |\n| `achievementState` | `enum (`[State](/games/services/web/api/rest/v1/achievements/list#State_1)`)` The state of the achievement. |\n| `lastUpdatedTimestamp` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` The timestamp of the last modification to this achievement's state. |\n| `experiencePoints` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` Experience points earned for the achievement. This field is absent for achievements that have not yet been unlocked and 0 for achievements that have been unlocked by testers but that are unpublished. |\n\nState\n-----\n\nDefines possible states of an achievement.\n\n| Enums ||\n|------------|--------------------------|\n| `HIDDEN` | Achievement is hidden. |\n| `REVEALED` | Achievement is revealed. |\n| `UNLOCKED` | Achievement is unlocked. |"]]