Method: achievements.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ê tiến trình của tất cả thành tích trong ứng dụng của bạn cho người chơi hiện được xác thực.
Yêu cầu HTTP
GET https://games.googleapis.com/games/v1/players/{playerId}/achievements
Tham số đường dẫn
Tham số |
playerId |
string
Mã nhận dạng người chơi. Bạn có thể sử dụng giá trị của me thay cho mã nhận dạng của người chơi đã xác thực.
|
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ề.
|
state |
enum (State )
Yêu cầu máy chủ chỉ trả về các thành tích ở trạng thái đã chỉ định. Nếu tham số này không được chỉ định, tất cả thành tích sẽ đượ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 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 (PlayerAchievement )
}
]
} |
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#playerAchievementListResponse cố định.
|
nextPageToken |
string
Mã thông báo tương ứng với trang kết quả tiếp theo.
|
items[] |
object (PlayerAchievement )
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.
Tiểu bang
Enum |
ALL |
Liệt kê tất cả thành tích. Đây là tuỳ chọn mặc định. |
HIDDEN |
Chỉ liệt kê những thành tích bị ẩn. |
REVEALED |
Danh sách chỉ được tiết lộ thành tích. |
UNLOCKED |
Chỉ liệt kê những thành tích đã mở khóa. |
PlayerAchievement
Một đối tượng thành tích.
Biểu diễn dưới dạng JSON |
{
"kind": string,
"id": string,
"currentSteps": integer,
"formattedCurrentStepsString": string,
"achievementState": enum (State ),
"lastUpdatedTimestamp": string,
"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#playerAchievement cố định.
|
id |
string
Mã của thành tích.
|
currentSteps |
integer
Các bước hiện tại để đạt được thành tích dần dần.
|
formattedCurrentStepsString |
string
Các bước hiện tại để đạt được thành tích gia tăng dưới dạng chuỗi.
|
achievementState |
enum (State )
Trạng thái của thành tích.
|
lastUpdatedTimestamp |
string (int64 format)
Dấu thời gian của lần sửa đổi gần đây nhất đối với trạng thái của thành tích này.
|
experiencePoints |
string (int64 format)
Số điểm kinh nghiệm kiếm được cho thành tích này. Trường này không có đối với thành tích chưa được mở khóa và 0 đối với thành tích mà người kiểm tra đã mở khóa nhưng chưa được xuất bản.
|
Tiểu bang
Xác định các trạng thái 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: 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. |"]]