Method: achievementDefinitions.list
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
HTTP 请求
GET https://games.googleapis.com/games/v1/achievements
查询参数
参数 |
language |
string
此方法返回的字符串的首选语言。
|
maxResults |
integer
响应中可返回的成就资源数量上限,用于分页。对于任何响应,返回的成就资源的实际数量都可能少于指定的 maxResults 。
|
pageToken |
string
上一个请求返回的令牌。
|
响应正文
成就定义对象的列表。
如果成功,响应正文将包含结构如下的数据:
字段 |
kind |
string
唯一标识此资源的类型。值始终为固定字符串 games#achievementDefinitionsListResponse 。
|
nextPageToken |
string
与下一页结果对应的令牌。
|
items[] |
object (AchievementDefinition )
成就定义。
|
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/games
https://www.googleapis.com/auth/games_lite
如需了解详情,请参阅 OAuth 2.0 概览。
AchievementDefinition
JSON 表示法 |
{
"kind": string,
"id": string,
"name": string,
"description": string,
"achievementType": enum (AchievementType ),
"totalSteps": integer,
"formattedTotalSteps": string,
"revealedIconUrl": string,
"isRevealedIconUrlDefault": boolean,
"unlockedIconUrl": string,
"isUnlockedIconUrlDefault": boolean,
"initialState": enum (InitialAchievementState ),
"experiencePoints": string
} |
字段 |
kind |
string
唯一标识此资源的类型。值始终为固定字符串 games#achievementDefinition 。
|
id |
string
成就的 ID。
|
name |
string
成就的名称。
|
description |
string
成就的说明。
|
achievementType |
enum (AchievementType )
成就的类型。
|
totalSteps |
integer
增量成就的总步数。
|
formattedTotalSteps |
string
增量成就的总步数(以字符串格式表示)。
|
revealedIconUrl |
string
已显示的成就图标的图片网址。
|
isRevealedIconUrlDefault |
boolean
指明要返回的已展开图标图片是默认图片还是由游戏提供的图片。
|
unlockedIconUrl |
string
已解锁成就图标的图片网址。
|
isUnlockedIconUrlDefault |
boolean
指明要返回的已解锁图标图片是默认图片还是游戏提供的图片。
|
initialState |
enum (InitialAchievementState )
成就的初始状态。
|
experiencePoints |
string (int64 format)
解锁此成就时将获得的经验值。
|
AchievementType
枚举 |
STANDARD |
成就处于锁定或解锁状态。 |
INCREMENTAL |
成就是分步解锁的。 |
InitialAchievementState
枚举 |
HIDDEN |
成就已隐藏。 |
REVEALED |
系统会显示成就。 |
UNLOCKED |
已解锁成就。 |
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Method: achievementDefinitions.list\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.ListAchievementDefinitionsResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [AchievementDefinition](#AchievementDefinition)\n - [JSON representation](#AchievementDefinition.SCHEMA_REPRESENTATION)\n- [AchievementType](#AchievementType)\n- [InitialAchievementState](#InitialAchievementState)\n- [Try it!](#try-it)\n\nLists all the achievement definitions for your application.\n\n### HTTP request\n\n`GET https://games.googleapis.com/games/v1/achievements`\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\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nA list of achievement definition 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/achievementDefinitions/list#AchievementDefinition) } ] } ``` |\n\n| Fields ||\n|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `kind` | `string` Uniquely identifies the type of this resource. Value is always the fixed string `games#achievementDefinitionsListResponse`. |\n| `nextPageToken` | `string` Token corresponding to the next page of results. |\n| `items[]` | `object (`[AchievementDefinition](/games/services/web/api/rest/v1/achievementDefinitions/list#AchievementDefinition)`)` The achievement definitions. |\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\nAchievementDefinition\n---------------------\n\nAn achievement definition object.\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"kind\": string, \"id\": string, \"name\": string, \"description\": string, \"achievementType\": enum (/games/services/web/api/rest/v1/achievementDefinitions/list#AchievementType), \"totalSteps\": integer, \"formattedTotalSteps\": string, \"revealedIconUrl\": string, \"isRevealedIconUrlDefault\": boolean, \"unlockedIconUrl\": string, \"isUnlockedIconUrlDefault\": boolean, \"initialState\": enum (/games/services/web/api/rest/v1/achievementDefinitions/list#InitialAchievementState), \"experiencePoints\": string } ``` |\n\n| Fields ||\n|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `kind` | `string` Uniquely identifies the type of this resource. Value is always the fixed string `games#achievementDefinition`. |\n| `id` | `string` The ID of the achievement. |\n| `name` | `string` The name of the achievement. |\n| `description` | `string` The description of the achievement. |\n| `achievementType` | `enum (`[AchievementType](/games/services/web/api/rest/v1/achievementDefinitions/list#AchievementType)`)` The type of the achievement. |\n| `totalSteps` | `integer` The total steps for an incremental achievement. |\n| `formattedTotalSteps` | `string` The total steps for an incremental achievement as a string. |\n| `revealedIconUrl` | `string` The image URL for the revealed achievement icon. |\n| `isRevealedIconUrlDefault` | `boolean` Indicates whether the revealed icon image being returned is a default image, or is provided by the game. |\n| `unlockedIconUrl` | `string` The image URL for the unlocked achievement icon. |\n| `isUnlockedIconUrlDefault` | `boolean` Indicates whether the unlocked icon image being returned is a default image, or is game-provided. |\n| `initialState` | `enum (`[InitialAchievementState](/games/services/web/api/rest/v1/achievementDefinitions/list#InitialAchievementState)`)` The initial state of the achievement. |\n| `experiencePoints` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` Experience points which will be earned when unlocking this achievement. |\n\nAchievementType\n---------------\n\nPossible achievement types.\n\n| Enums ||\n|---------------|-------------------------------------------|\n| `STANDARD` | Achievement is either locked or unlocked. |\n| `INCREMENTAL` | Achievement is incremental. |\n\nInitialAchievementState\n-----------------------\n\nPossible initial states of an achievement.\n\n| Enums ||\n|------------|--------------------------|\n| `HIDDEN` | Achievement is hidden. |\n| `REVEALED` | Achievement is revealed. |\n| `UNLOCKED` | Achievement is unlocked. |"]]