Method: recall.linkPersona

Associate the PGS Player principal encoded in the provided recall session id with an in-game account

HTTP request

POST https://games.googleapis.com/games/v1/recall:linkPersona

Request body

The request body contains data with the following structure:

JSON representation
{
  "sessionId": string,
  "persona": string,
  "token": string,
  "cardinalityConstraint": enum (RecallTokensCardinalityConstraint),
  "conflictingLinksResolutionPolicy": enum (ConflictingLinksResolutionPolicy),

  // Union field expiration can be only one of the following:
  "expireTime": string,
  "ttl": string
  // End of list of possible types for union field expiration.
}
Fields
sessionId

string

Required. Opaque server-generated string that encodes all the necessary information to identify the PGS player / Google user and application.

persona

string

Required. Stable identifier of the in-game account. Please refrain from re-using the same persona for different games.

token

string

Required. Value of the token to create. Opaque to Play Games and assumed to be non-stable (encrypted with key rotation).

cardinalityConstraint

enum (RecallTokensCardinalityConstraint)

Required. Cardinality constraint to observe when linking a persona to a player in the scope of a game.

Union field expiration. Optional token expiration time or time to live. expiration can be only one of the following:
expireTime

string (Timestamp format)

Input only. Optional expiration time.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

ttl

string (Duration format)

Input only. Optional time-to-live.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

Response body

Outcome of a persona linking attempt.

If successful, the response body contains data with the following structure:

JSON representation
{
  "state": enum (State)
}
Fields
state

enum (State)

Output only. State of a persona linking attempt.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/androidpublisher

For more information, see the OAuth 2.0 Overview.

RecallTokensCardinalityConstraint

Cardinality constraint to observe when linking a persona to a player in the scope of a game.

Enums
ONE_PERSONA_TO_ONE_PLAYER

1:1 cardinality between in-game personas and Play Games Services players.

By the end of the linking operation only one entry for the player and the persona should remain in the scope of the application.

Whether a new link is created or not when this constraint is specified is determined by the chosen ConflictingLinksResolutionPolicy:

  • If KEEP_EXISTING_LINKS is specified and the provided persona is already linked to a different player, or the player is already linked to a different persona, no new link will be created and the already existing link(s) will remain as is(are).

  • If CREATE_NEW_LINK is specified and the provided persona is already linked to a different player, or the player is already linked to another persona, the older link(s) will be removed in favour of the new link being created.

ConflictingLinksResolutionPolicy

Resolution policy to apply when the linking of a persona to a player would result in violating the specified cardinality constraint.

Enums

State

State of a persona linking attempt.

Enums
PERSONA_OR_PLAYER_ALREADY_LINKED The link specified in the request was not created because already existing links would result in the new link violating the specified RecallTokensCardinalityConstraint if created.