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)
获得的成就对应的经验值。对于尚未解锁的成就,此字段不存在;对于已由测试人员解锁但尚未发布的成就,此字段的值为 0。
|
状态
枚举 |
HIDDEN |
成就已隐藏。 |
REVEALED |
系统会显示成就。 |
UNLOCKED |
已解锁成就。 |
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):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. |"]]