Method: players.list
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
HTTP 请求
GET https://games.googleapis.com/games/v1/players/me/players/{collection}
路径参数
参数 |
collection |
enum (Collection )
要检索的玩家集合
|
查询参数
参数 |
language |
string
此方法返回的字符串的首选语言。
|
maxResults |
integer
响应中可返回的播放器资源的数量上限,用于分页。对于任何响应,返回的实际播放器资源数量都可能少于指定的 maxResults 。
|
pageToken |
string
上一个请求返回的令牌。
|
响应正文
第三方播放器列表响应。
如果成功,响应正文将包含结构如下的数据:
JSON 表示法 |
{
"kind": string,
"nextPageToken": string,
"items": [
{
object (Player )
}
]
} |
字段 |
kind |
string
唯一标识此资源的类型。值始终为固定字符串 games#playerListResponse 。
|
nextPageToken |
string
与下一页结果对应的令牌。
|
items[] |
object (Player )
玩家。
|
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/games
https://www.googleapis.com/auth/games_lite
如需了解详情,请参阅 OAuth 2.0 概览。
Collection
枚举 |
CONNECTED |
按时间倒序检索也正在玩此游戏的玩家列表。 |
VISIBLE |
检索用户社交图谱中对此游戏可见的玩家列表。 |
FRIENDS_ALL |
按字母顺序检索与用户是好友的玩家列表。 |
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Method: players.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.ListPlayersResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Collection](#Collection)\n- [Try it!](#try-it)\n\nGet the collection of players for the currently authenticated user.\n\n### HTTP request\n\n`GET https://games.googleapis.com/games/v1/players/me/players/{collection}`\n\n### Path parameters\n\n| Parameters ||\n|--------------|------------------------------------------------------------------------------------------------------------------------|\n| `collection` | `enum (`[Collection](/games/services/web/api/rest/v1/players/list#Collection)`)` Collection of players being retrieved |\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 player resources to return in the response, used for paging. For any response, the actual number of player 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 third party player list response.\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/players#Player) } ] } ``` |\n\n| Fields ||\n|-----------------|----------------------------------------------------------------------------------------------------------------------|\n| `kind` | `string` Uniquely identifies the type of this resource. Value is always the fixed string `games#playerListResponse`. |\n| `nextPageToken` | `string` Token corresponding to the next page of results. |\n| `items[]` | `object (`[Player](/games/services/web/api/rest/v1/players#Player)`)` The players. |\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\nCollection\n----------\n\n| Enums ||\n|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `CONNECTED` | Retrieve a list of players that are also playing this game in reverse chronological order. | The CONNECTED collection of G+ friends is deprecated, use the FRIENDS_ALL collection instead. |\n| `VISIBLE` | Retrieve a list of players in the user's social graph that are visible to this game. | The VISIBLE collection of G+ friends is deprecated, use the FRIENDS_ALL collection instead. |\n| `FRIENDS_ALL` | Retrieve a list of players who are friends of the user in alphabetical order. |"]]