Method: achievementDefinitions.list
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Liệt kê tất cả định nghĩa thành tích cho ứng dụng của bạn.
Yêu cầu HTTP
GET https://games.googleapis.com/games/v1/achievements
Tham số truy vấn
Tham số |
language |
string
Ngôn ngữ ưu tiên để sử dụng cho các chuỗi được phương thức này trả về.
|
maxResults |
integer
Số lượng tài nguyên thành tích tối đa cần trả về trong phản hồi, dùng để phân trang. Đối với bất kỳ phản hồi nào, số lượng tài nguyên thành tích thực tế được trả về có thể ít hơn maxResults được chỉ định.
|
pageToken |
string
Mã thông báo do yêu cầu trước đó trả về.
|
Nội dung yêu cầu
Nội dung yêu cầu phải trống.
Nội dung phản hồi
Danh sách các đối tượng định nghĩa thành tích.
Nếu thành công, phần nội dung phản hồi sẽ chứa dữ liệu có cấu trúc sau:
Biểu diễn dưới dạng JSON |
{
"kind": string,
"nextPageToken": string,
"items": [
{
object (AchievementDefinition )
}
]
} |
Trường |
kind |
string
Xác định duy nhất loại tài nguyên này. Giá trị luôn là chuỗi games#achievementDefinitionsListResponse cố định.
|
nextPageToken |
string
Mã thông báo tương ứng với trang kết quả tiếp theo.
|
items[] |
object (AchievementDefinition )
Định nghĩa thành tích.
|
Phạm vi uỷ quyền
Yêu cầu một trong các phạm vi OAuth sau:
https://www.googleapis.com/auth/games
https://www.googleapis.com/auth/games_lite
Để biết thêm thông tin, hãy xem bài viết Tổng quan về OAuth 2.0.
AchievementDefinition
Đối tượng định nghĩa thành tích.
Biểu diễn dưới dạng 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
} |
Trường |
kind |
string
Xác định duy nhất loại tài nguyên này. Giá trị luôn là chuỗi games#achievementDefinition cố định.
|
id |
string
Mã của thành tích.
|
name |
string
Tên của thành tích.
|
description |
string
Nội dung mô tả về thành tích.
|
achievementType |
enum (AchievementType )
Loại thành tích.
|
totalSteps |
integer
Tổng số bước để đạt được một thành tích gia tăng.
|
formattedTotalSteps |
string
Tổng số bước của một thành tích tăng dần dưới dạng một chuỗi.
|
revealedIconUrl |
string
URL hình ảnh của biểu tượng thành tích đã công bố.
|
isRevealedIconUrlDefault |
boolean
Cho biết liệu hình ảnh biểu tượng được tiết lộ mà hệ thống trả về là hình ảnh mặc định hay do trò chơi cung cấp.
|
unlockedIconUrl |
string
URL hình ảnh của biểu tượng thành tích đã mở khoá.
|
isUnlockedIconUrlDefault |
boolean
Cho biết liệu hình ảnh biểu tượng đã mở khoá được trả về là hình ảnh mặc định hay do trò chơi cung cấp.
|
initialState |
enum (InitialAchievementState )
Trạng thái ban đầu của thành tích.
|
experiencePoints |
string (int64 format)
Điểm kinh nghiệm bạn sẽ nhận được khi mở khoá thành tích này.
|
AchievementType
Các loại thành tích có thể có.
Enum |
STANDARD |
Thành tích đang bị khoá hoặc đã mở khoá. |
INCREMENTAL |
Thành tích ngày càng gia tăng. |
InitialAchievementState
Các trạng thái ban đầu có thể có của một thành tích.
Enum |
HIDDEN |
Thành tích bị ẩn. |
REVEALED |
Thành tích đã được tiết lộ. |
UNLOCKED |
Thành tích đã được mở khoá. |
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],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. |"]]