Method: players.get
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.
Truy xuất tài nguyên Trình phát bằng mã nhận dạng cho trước. Để truy xuất trình phát cho người dùng hiện đã được xác thực, hãy đặt playerId
thành me
.
Yêu cầu HTTP
GET https://games.googleapis.com/games/v1/players/{playerId}
Tham số đường dẫn
Các tham số |
playerId |
string
Mã nhận dạng người chơi. Giá trị của me có thể được sử dụng thay cho mã của người chơi đã xác thực.
|
Tham số truy vấn
Các tham số |
language |
string
Ngôn ngữ ưu tiên dùng cho các chuỗi được phương thức này trả về.
|
playerIdConsistencyToken |
string
Mã thông báo về tính nhất quán của mã người chơi. Lệnh gọi trả về kết quả "không tìm thấy" khi có mã thông báo và không hợp lệ. Giá trị trống sẽ bị bỏ qua. Xem thêm GlobalPlayerIdConsistencyTokenProto
|
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
Nếu thành công, nội dung phản hồi sẽ chứa một phiên bản của Player
.
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 Tổng quan về OAuth 2.0.
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: players.get\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- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nRetrieves the Player resource with the given ID. To retrieve the player for the currently authenticated user, set `playerId` to `me`.\n\n### HTTP request\n\n`GET https://games.googleapis.com/games/v1/players/{playerId}`\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| `playerIdConsistencyToken` | `string` Consistency token of the player id. The call returns a 'not found' result when the token is present and invalid. Empty value is ignored. See also GlobalPlayerIdConsistencyTokenProto |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains an instance of [Player](/games/services/web/api/rest/v1/players#Player).\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)."]]