REST Resource: players

Resource: Player

A Player resource.

JSON representation
{
  "kind": string,
  "playerId": string,
  "displayName": string,
  "avatarImageUrl": string,
  "bannerUrlPortrait": string,
  "bannerUrlLandscape": string,
  "originalPlayerId": string,
  "profileSettings": {
    object (ProfileSettings)
  },
  "name": {
    "familyName": string,
    "givenName": string
  },
  "experienceInfo": {
    object (PlayerExperienceInfo)
  },
  "title": string,
  "friendStatus": enum (FriendStatus),
  "gamePlayerId": string
}
Fields
kind

string

Uniquely identifies the type of this resource. Value is always the fixed string games#player

playerId

string

The ID of the player.

displayName

string

The name to display for the player.

avatarImageUrl

string

The base URL for the image that represents the player.

bannerUrlPortrait

string

The url to the portrait mode player banner image.

bannerUrlLandscape

string

The url to the landscape mode player banner image.

originalPlayerId

string

The player ID that was used for this player the first time they signed into the game in question. This is only populated for calls to player.get for the requesting player, only if the player ID has subsequently changed, and only to clients that support remapping player IDs.

profileSettings

object (ProfileSettings)

The player's profile settings. Controls whether or not the player's profile is visible to other players.

name

object

An object representation of the individual components of the player's name. For some players, these fields may not be present.

name.familyName

string

The family name of this player. In some places, this is known as the last name.

name.givenName

string

The given name of this player. In some places, this is known as the first name.

experienceInfo

object (PlayerExperienceInfo)

An object to represent Play Game experience information for the player.

title

string

The player's title rewarded for their game activities.

friendStatus

enum (FriendStatus)

The friend status of the given player, relative to the requester. This is unset if the player is not sharing their friends list with the game.

gamePlayerId

string

Per-application unique player identifier.

ProfileSettings

Profile settings

JSON representation
{
  "kind": string,
  "profileVisible": boolean,
  "friendsListVisibility": enum (FriendsListVisibility)
}
Fields
kind

string

Uniquely identifies the type of this resource. Value is always the fixed string games#profileSettings.

profileVisible

boolean

Whether the player's profile is visible to the currently signed in player.

friendsListVisibility

enum (FriendsListVisibility)

FriendsListVisibility

Whether the player's friends list is visible to this game, or can be requested. This field is only populated for the currently signed in player.

Enums
VISIBLE The friends list is currently visible to the game.
REQUEST_REQUIRED The developer does not have access to the friends list, but can call the Android API to show a consent dialog.
UNAVAILABLE The friends list is currently unavailable for this user, and it is not possible to request access at this time, either because the user has permanently declined or the friends feature is not available to them. In this state, any attempts to request access to the friends list will be unsuccessful.

PlayerExperienceInfo

1P/3P metadata about the player's experience.

JSON representation
{
  "kind": string,
  "currentExperiencePoints": string,
  "lastLevelUpTimestampMillis": string,
  "currentLevel": {
    object (PlayerLevel)
  },
  "nextLevel": {
    object (PlayerLevel)
  }
}
Fields
kind

string

Uniquely identifies the type of this resource. Value is always the fixed string games#playerExperienceInfo.

currentExperiencePoints

string (int64 format)

The current number of experience points for the player.

lastLevelUpTimestampMillis

string (int64 format)

The timestamp when the player was leveled up, in millis since Unix epoch UTC.

currentLevel

object (PlayerLevel)

The current level of the player.

nextLevel

object (PlayerLevel)

The next level of the player. If the current level is the maximum level, this should be same as the current level.

PlayerLevel

1P/3P metadata about a user's level.

JSON representation
{
  "kind": string,
  "level": integer,
  "minExperiencePoints": string,
  "maxExperiencePoints": string
}
Fields
kind

string

Uniquely identifies the type of this resource. Value is always the fixed string games#playerLevel.

level

integer

The level for the user.

minExperiencePoints

string (int64 format)

The minimum experience points for this level.

maxExperiencePoints

string (int64 format)

The maximum experience points for this level.

FriendStatus

Defines friendship relations between players.

Enums
NO_RELATIONSHIP There is no relationship between the players.
FRIEND The player and requester are friends.

Methods

get

Retrieves the Player resource with the given ID.

getMultipleApplicationPlayerIds

Get the application player ids for the currently authenticated player across all requested games by the same developer as the calling application.

getScopedPlayerIds

Retrieves scoped player identifiers for currently authenticated user.

list

Get the collection of players for the currently authenticated user.