Documentation

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.

Request Details

GetFriendsListRequest
Request Properties
IncludeFacebookFriends Boolean

Indicates whether Facebook friends should be included in the response. Default is true.

IncludeSteamFriends Boolean

Indicates whether Steam service friends should be included in the response. Default is true.

PlayFabId (required) String

PlayFab identifier of the player whose friend list to get.

ProfileConstraints PlayerProfileViewConstraints

If non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, only the allowed client profile properties for the title may be requested. These allowed properties are configured in the Game Manager "Client Profile Options" tab in the "Settings" section.

XboxToken String

Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab.

POST https://{{TitleID}}.playfabapi.com/Server/GetFriendsList
    Content-Type: application/json
    X-SecretKey: <developer_secret_key>
{
  "PlayFabId": "93798903892789754",
  "IncludeSteamFriends": true
}
        

Response Details

If any additional services are queried for the user's friends, those friends who also have a PlayFab account registered for the title will be returned in the results. For Facebook, user has to have logged into the title's Facebook app recently, and only friends who also plays this game will be included.

GetFriendsListResult
Result Properties
Friends List<FriendInfo>

Array of friends found.

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "Friends": [
      {
        "FriendPlayFabId": "93798903892789754",
        "Username": "accountName",
        "TitleDisplayName": "Davros01",
        "Tags": [
          "single blue eye",
          "genius with robotics"
        ],
        "CurrentMatchmakerLobbyId": "2073",
        "Profile": {
          "AvatarUrl": "https://example.org/profile1.jpg",
          "Statistics": [
            {
              "Name": "Points",
              "Version": 2,
              "Value": 7
            },
            {
              "Name": "Points",
              "Version": 1,
              "Value": 40
            },
            {
              "Name": "XP",
              "Version": 1,
              "Value": 10
            }
          ]
        }
      },
      {
        "FriendPlayFabId": "334907923945f",
        "Username": "accountName",
        "TitleDisplayName": "CyberLeader1",
        "Tags": [
          "allergic to gold",
          "upgradeable"
        ],
        "CurrentMatchmakerLobbyId": "2073",
        "Profile": {
          "AvatarUrl": "https://example.org/profile2.jpg",
          "Statistics": [
            {
              "Name": "Points",
              "Version": 2,
              "Value": 15
            },
            {
              "Name": "XP",
              "Version": 1,
              "Value": 10
            }
          ]
        }
      }
    ]
  }
}

Authentication

SecretKey

Possible Error Codes

Name Code
AccountNotFound 1001
FacebookAPIError 1143