Method: players.get
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
擷取具有指定 ID 的玩家資源。如要擷取目前已驗證使用者的玩家,請將 playerId
設為 me
。
HTTP 要求
GET https://games.googleapis.com/games/v1/players/{playerId}
路徑參數
參數 |
playerId |
string
玩家 ID。me 的值可用來取代已驗證玩家的 ID。
|
查詢參數
參數 |
language |
string
此方法傳回的字串偏好語言。
|
playerIdConsistencyToken |
string
玩家 ID 的一致性權杖。如果符記存在且無效,呼叫會傳回「找不到」的結果。系統會忽略空白值。另請參閱 GlobalPlayerIdConsistencyTokenProto
|
回應主體
如果成功,回應主體會包含 Player
的執行例項。
授權範圍
需要下列其中一種 OAuth 範圍:
https://www.googleapis.com/auth/games
https://www.googleapis.com/auth/games_lite
詳情請參閱 OAuth 2.0 總覽。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[null,null,["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],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)."]]