Players

A Player represents a human player in Leaderboards and Achievements.

For a list of methods for this resource, see the end of this page.

Resource representations

This is a JSON template for a Player resource.

{
  "kind": "games#player",
  "playerId": string,
  "displayName": string,
  "avatarImageUrl": string,
  "bannerUrlPortrait": string,
  "bannerUrlLandscape": string,
  "originalPlayerId": string,
  "lastPlayedWith": {
    "kind": "games#played",
    "timeMillis": long,
    "autoMatched": boolean
  },
  "profileSettings": {
    "kind": "games#profileSettings",
    "profileVisible": boolean,
    "friendsListVisibility": string
  },
  "name": {
    "familyName": string,
    "givenName": string
  },
  "experienceInfo": {
    "kind": "games#playerExperienceInfo",
    "currentExperiencePoints": long,
    "lastLevelUpTimestampMillis": long,
    "currentLevel": {
      "kind": "games#playerLevel",
      "level": integer,
      "minExperiencePoints": long,
      "maxExperiencePoints": long
    },
    "nextLevel": {
      "kind": "games#playerLevel",
      "level": integer,
      "minExperiencePoints": long,
      "maxExperiencePoints": long
    }
  },
  "title": string,
  "friendStatus": string
}
Property name Value Description Notes
avatarImageUrl string The base URL for the image that represents the player.
bannerUrlLandscape string The url to the landscape mode player banner image.
bannerUrlPortrait string The url to the portrait mode player banner image.
displayName string The name to display for the player.
experienceInfo nested object An object to represent Play Game experience information for the player.
experienceInfo.currentExperiencePoints long The current number of experience points for the player.
experienceInfo.currentLevel nested object The current level of the player.
experienceInfo.currentLevel.kind string Uniquely identifies the type of this resource. Value is always the fixed string games#playerLevel.
experienceInfo.currentLevel.level integer The level for the user.
experienceInfo.currentLevel.maxExperiencePoints long The maximum experience points for this level.
experienceInfo.currentLevel.minExperiencePoints long The minimum experience points for this level.
experienceInfo.kind string Uniquely identifies the type of this resource. Value is always the fixed string games#playerExperienceInfo.
experienceInfo.lastLevelUpTimestampMillis long The timestamp when the player was leveled up, in millis since Unix epoch UTC.
experienceInfo.nextLevel nested object The next level of the player. If the current level is the maximum level, this should be same as the current level.
experienceInfo.nextLevel.kind string Uniquely identifies the type of this resource. Value is always the fixed string games#playerLevel.
experienceInfo.nextLevel.level integer The level for the user.
experienceInfo.nextLevel.maxExperiencePoints long The maximum experience points for this level.
experienceInfo.nextLevel.minExperiencePoints long The minimum experience points for this level.
friendStatus string 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.

Acceptable values are:
  • "FRIEND"
  • "NO_RELATIONSHIP"
kind string Uniquely identifies the type of this resource. Value is always the fixed string games#player.
lastPlayedWith nested object Details about the last time this player played a multiplayer game with the currently authenticated player. Populated for PLAYED_WITH player collection members.
lastPlayedWith.autoMatched boolean True if the player was auto-matched with the currently authenticated user.
lastPlayedWith.kind string Uniquely identifies the type of this resource. Value is always the fixed string games#played.
lastPlayedWith.timeMillis long The last time the player played the game in milliseconds since the epoch in UTC.
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.
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.
playerId string The ID of the player.
profileSettings nested object The player's profile settings. Controls whether or not the player's profile is visible to other players.
profileSettings.friendsListVisibility string Whether the player's friends list is visible to the game.

Acceptable values are:
  • "REQUEST_REQUIRED"
  • "UNAVAILABLE"
  • "VISIBLE"
profileSettings.kind string Uniquely identifies the type of this resource. Value is always the fixed string games#profileSettings.
profileSettings.profileVisible boolean
title string The player's title rewarded for their game activities.

Methods

get
Retrieves the Player resource with the given ID. To retrieve the player for the currently authenticated user, set playerId to me.
list
Get the collection of players for the currently authenticated user.