PlayFab Server API
Provides functionality to allow external (developer-controlled) servers to interact with user inventories and data in a trusted manner, and to handle matchmaking and client connection orchestration
Account Management
-
BanUsers
Bans users by PlayFab ID with optional IP address, or MAC address for the provided game.
-
DeletePlayer
Removes a user's player account from a title and deletes all associated data
-
GetPlayerProfile
Retrieves the player's profile
-
GetPlayFabIDsFromFacebookIDs
Retrieves the unique PlayFab identifiers for the given set of Facebook identifiers.
-
GetPlayFabIDsFromFacebookInstantGamesIds
Retrieves the unique PlayFab identifiers for the given set of Facebook Instant Games identifiers.
-
GetPlayFabIDsFromNintendoSwitchDeviceIds
Retrieves the unique PlayFab identifiers for the given set of Nintendo Switch Device identifiers.
-
GetPlayFabIDsFromPSNAccountIDs
Retrieves the unique PlayFab identifiers for the given set of PlayStation Network identifiers.
-
GetPlayFabIDsFromSteamIDs
Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile IDs for the user accounts, available as SteamId in the Steamworks Community API calls.
-
GetPlayFabIDsFromXboxLiveIDs
Retrieves the unique PlayFab identifiers for the given set of XboxLive identifiers.
-
GetServerCustomIDsFromPlayFabIDs
Retrieves the associated PlayFab account identifiers for the given set of server custom identifiers.
-
GetUserAccountInfo
Retrieves the relevant details for a specified user
-
GetUserBans
Gets all bans for a user.
-
LinkXboxAccount
Links the Xbox Live account associated with the provided access code to the user's PlayFab account
-
RevokeAllBansForUser
Revoke all active bans for a user.
-
RevokeBans
Revoke all active bans specified with BanId.
-
SendCustomAccountRecoveryEmail
Forces an email to be sent to the registered contact email address for the user's account based on an account recovery email template
-
SendEmailFromTemplate
Sends an email based on an email template to a player's contact email
-
SendPushNotification
Sends an iOS/Android Push Notification to a specific user, if that user's device has been configured for Push Notifications in PlayFab. If a user has linked both Android and iOS devices, both will be notified.
-
UnlinkXboxAccount
Unlinks the related Xbox Live account from the user's PlayFab account
-
UpdateAvatarUrl
Update the avatar URL of the specified player
-
UpdateBans
Updates information of a list of existing bans specified with Ban Ids.
Analytics
-
WriteCharacterEvent
Writes a character-based event into PlayStream.
-
WritePlayerEvent
Writes a player-based event into PlayStream.
-
WriteTitleEvent
Writes a title-based event into PlayStream.
Authentication
-
AuthenticateSessionTicket
Validated a client's session ticket, and if successful, returns details for that user
-
LoginWithServerCustomId
Securely login a game client from an external server backend using a custom identifier for that player. Server Custom ID and Client Custom ID are mutually exclusive and cannot be used to retrieve the same player account.
-
LoginWithXbox
Signs the user in using a Xbox Live Token from an external server backend, returning a session identifier that can subsequently be used for API calls which require an authenticated user
-
SetPlayerSecret
Sets the player's secret if it is not already set. Player secrets are used to sign API requests. To reset a player's secret use the Admin or Server API method SetPlayerSecret.
Character Data
-
GetCharacterData
Retrieves the title-specific custom data for the user which is readable and writable by the client
-
GetCharacterInternalData
Retrieves the title-specific custom data for the user's character which cannot be accessed by the client
-
GetCharacterReadOnlyData
Retrieves the title-specific custom data for the user's character which can only be read by the client
-
UpdateCharacterData
Updates the title-specific custom data for the user's character which is readable and writable by the client
-
UpdateCharacterInternalData
Updates the title-specific custom data for the user's character which cannot be accessed by the client
-
UpdateCharacterReadOnlyData
Updates the title-specific custom data for the user's character which can only be read by the client
Characters
-
DeleteCharacterFromUser
Deletes the specific character ID from the specified user.
-
GetAllUsersCharacters
Lists all of the characters that belong to a specific user. CharacterIds are not globally unique; characterId must be evaluated with the parent PlayFabId to guarantee uniqueness.
-
GetCharacterLeaderboard
Retrieves a list of ranked characters for the given statistic, starting from the indicated point in the leaderboard
-
GetCharacterStatistics
Retrieves the details of all title-specific statistics for the specific character
-
GetLeaderboardAroundCharacter
Retrieves a list of ranked characters for the given statistic, centered on the requested user
-
GetLeaderboardForUserCharacters
Retrieves a list of all of the user's characters for the given statistic.
-
GrantCharacterToUser
Grants the specified character type to the user. CharacterIds are not globally unique; characterId must be evaluated with the parent PlayFabId to guarantee uniqueness.
-
UpdateCharacterStatistics
Updates the values of the specified title-specific statistics for the specific character
Content
-
GetContentDownloadUrl
This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, the query to retrieve the data will fail. See this post for more information: https://community.playfab.com/hc/en-us/community/posts/205469488-How-to-upload-files-to-PlayFab-s-Content-Service. Also, please be aware that the Content service is specifically PlayFab's CDN offering, for which standard CDN rates apply.
Friend List Management
-
AddFriend
Adds the Friend user to the friendlist of the user with PlayFabId. At least one of FriendPlayFabId,FriendUsername,FriendEmail, or FriendTitleDisplayName should be initialized.
-
GetFriendsList
Retrieves the current friends for the user with PlayFabId, constrained to users who have PlayFab accounts. Friends from linked accounts (Facebook, Steam) are also included. You may optionally exclude some linked services' friends.
-
RemoveFriend
Removes the specified friend from the the user's friend list
-
SetFriendTags
Updates the tag list for a specified user in the friend list of another user
Matchmaking
-
DeregisterGame
Inform the matchmaker that a Game Server Instance is removed.
-
NotifyMatchmakerPlayerLeft
Informs the PlayFab match-making service that the user specified has left the Game Server Instance
-
RedeemMatchmakerTicket
Validates a Game Server session ticket and returns details about the user
-
RefreshGameServerInstanceHeartbeat
Set the state of the indicated Game Server Instance. Also update the heartbeat for the instance.
-
RegisterGame
Inform the matchmaker that a new Game Server Instance is added.
-
SetGameServerInstanceData
Sets the custom data of the indicated Game Server Instance
-
SetGameServerInstanceState
Set the state of the indicated Game Server Instance.
-
SetGameServerInstanceTags
Set custom tags for the specified Game Server Instance
Platform Specific Methods
-
AwardSteamAchievement
Awards the specified users the specified Steam achievements
Player Data Management
-
GetFriendLeaderboard
Retrieves a list of ranked friends of the given player for the given statistic, starting from the indicated point in the leaderboard
-
GetLeaderboard
Retrieves a list of ranked users for the given statistic, starting from the indicated point in the leaderboard
-
GetLeaderboardAroundUser
Retrieves a list of ranked users for the given statistic, centered on the currently signed-in user
-
GetPlayerCombinedInfo
Returns whatever info is requested in the response for the user. Note that PII (like email address, facebook id) may be returned. All parameters default to false.
-
GetPlayerStatistics
Retrieves the current version and values for the indicated statistics, for the local player.
-
GetPlayerStatisticVersions
Retrieves the information on the available versions of the specified statistic.
-
GetUserData
Retrieves the title-specific custom data for the user which is readable and writable by the client
-
GetUserInternalData
Retrieves the title-specific custom data for the user which cannot be accessed by the client
-
GetUserPublisherData
Retrieves the publisher-specific custom data for the user which is readable and writable by the client
-
GetUserPublisherInternalData
Retrieves the publisher-specific custom data for the user which cannot be accessed by the client
-
GetUserPublisherReadOnlyData
Retrieves the publisher-specific custom data for the user which can only be read by the client
-
GetUserReadOnlyData
Retrieves the title-specific custom data for the user which can only be read by the client
-
UpdatePlayerStatistics
Updates the values of the specified title-specific statistics for the user
-
UpdateUserData
Updates the title-specific custom data for the user which is readable and writable by the client
-
UpdateUserInternalData
Updates the title-specific custom data for the user which cannot be accessed by the client
-
UpdateUserPublisherData
Updates the publisher-specific custom data for the user which is readable and writable by the client
-
UpdateUserPublisherInternalData
Updates the publisher-specific custom data for the user which cannot be accessed by the client
-
UpdateUserPublisherReadOnlyData
Updates the publisher-specific custom data for the user which can only be read by the client
-
UpdateUserReadOnlyData
Updates the title-specific custom data for the user which can only be read by the client
Player Item Management
-
AddCharacterVirtualCurrency
Increments the character's balance of the specified virtual currency by the stated amount
-
AddUserVirtualCurrency
Increments the user's balance of the specified virtual currency by the stated amount
-
ConsumeItem
Consume uses of a consumable item. When all uses are consumed, it will be removed from the player's inventory.
-
EvaluateRandomResultTable
Returns the result of an evaluation of a Random Result Table - the ItemId from the game Catalog which would have been added to the player inventory, if the Random Result Table were added via a Bundle or a call to UnlockContainer.
-
GetCharacterInventory
Retrieves the specified character's current inventory of virtual goods
-
GetRandomResultTables
Retrieves the configuration information for the specified random results tables for the title, including all ItemId values and weights
-
GetUserInventory
Retrieves the specified user's current inventory of virtual goods
-
GrantItemsToCharacter
Adds the specified items to the specified character's inventory
-
GrantItemsToUser
Adds the specified items to the specified user's inventory
-
GrantItemsToUsers
Adds the specified items to the specified user inventories
-
ModifyItemUses
Modifies the number of remaining uses of a player's inventory item
-
MoveItemToCharacterFromCharacter
Moves an item from a character's inventory into another of the users's character's inventory.
-
MoveItemToCharacterFromUser
Moves an item from a user's inventory into their character's inventory.
-
MoveItemToUserFromCharacter
Moves an item from a character's inventory into the owning user's inventory.
-
RedeemCoupon
Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager.
-
ReportPlayer
Submit a report about a player (due to bad bahavior, etc.) on behalf of another player, so that customer service representatives for the title can take action concerning potentially toxic players.
-
RevokeInventoryItem
Revokes access to an item in a user's inventory
-
RevokeInventoryItems
Revokes access for up to 25 items across multiple users and characters.
-
SubtractCharacterVirtualCurrency
Decrements the character's balance of the specified virtual currency by the stated amount. It is possible to make a VC balance negative with this API.
-
SubtractUserVirtualCurrency
Decrements the user's balance of the specified virtual currency by the stated amount. It is possible to make a VC balance negative with this API.
-
UnlockContainerInstance
Opens a specific container (ContainerItemInstanceId), with a specific key (KeyItemInstanceId, when required), and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem.
-
UnlockContainerItem
Searches Player or Character inventory for any ItemInstance matching the given CatalogItemId, if necessary unlocks it using any appropriate key, and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem.
-
UpdateUserInventoryItemCustomData
Updates the key-value pair data tagged to the specified item, which is read-only from the client.
PlayStream
-
AddPlayerTag
Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag.
-
GetAllSegments
Retrieves an array of player segment definitions. Results from this can be used in subsequent API calls such as GetPlayersInSegment which requires a Segment ID. While segment names can change the ID for that segment will not change.
-
GetPlayerSegments
List all segments that a player currently belongs to at this moment in time.
-
GetPlayersInSegment
Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected in the results. AB Test segments are currently not supported by this operation.
-
GetPlayerTags
Get all tags with a given Namespace (optional) from a player profile.
-
RemovePlayerTag
Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag.
Server-Side Cloud Script
-
ExecuteCloudScript
Executes a CloudScript function, with the 'currentPlayerId' variable set to the specified PlayFabId parameter value.
Shared Group Data
-
AddSharedGroupMembers
Adds users to the set of those able to update both the shared data, as well as the set of users in the group. Only users in the group (and the server) can add new members. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups
-
CreateSharedGroup
Requests the creation of a shared group object, containing key/value pairs which may be updated by all members of the group. When created by a server, the group will initially have no members. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups
-
DeleteSharedGroup
Deletes a shared group, freeing up the shared group ID to be reused for a new group. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups
-
GetSharedGroupData
Retrieves data stored in a shared group object, as well as the list of members in the group. The server can access all public and private group data. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups
-
RemoveSharedGroupMembers
Removes users from the set of those able to update the shared data and the set of users in the group. Only users in the group can remove members. If as a result of the call, zero users remain with access, the group and its associated data will be deleted. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups
-
UpdateSharedGroupData
Adds, updates, and removes data keys for a shared group object. If the permission is set to Public, all fields updated or added in this call will be readable by users not in the group. By default, data permissions are set to Private. Regardless of the permission setting, only members of the group (and the server) can update the data. Shared Groups are designed for sharing data between a very small number of players, please see our guide: https://api.playfab.com/docs/tutorials/landing-players/shared-groups
Title-Wide Data Management
-
GetCatalogItems
Retrieves the specified version of the title's catalog of virtual goods, including all defined properties
-
GetPublisherData
Retrieves the key-value store of custom publisher settings
-
GetTime
Retrieves the current server time
-
GetTitleData
Retrieves the key-value store of custom title settings
-
GetTitleInternalData
Retrieves the key-value store of custom internal title settings
-
GetTitleNews
Retrieves the title news feed, as configured in the developer portal
-
SetPublisherData
Updates the key-value store of custom publisher settings
-
SetTitleData
Updates the key-value store of custom title settings
-
SetTitleInternalData
Updates the key-value store of custom title settings