Method: players.get
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
检索具有指定 ID 的 Player 资源。如需检索当前已通过身份验证的用户的玩家,请将 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 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):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)."]]