question

Daniel Bonrath avatar image
Daniel Bonrath asked

LinkedAccounts not containing all linked accounts

Hi there,

I'm trying to get all linked accounts of a player for leaderboards to show the platform name (consoles) and some other properties depending on some platform specifics. My test account at the moment is linked to a custom ID and a Steam ID. Both GetPlayerProfile and GetLeaderboard though just have one LinkedAccounts entry which refers to the custom ID. Am I doing something wrong here?

Best regards,
Daniel

Player DataAccount ManagementLeaderboards and Statistics
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Daniel Bonrath avatar image Daniel Bonrath commented ·
PlayFabClientAPI.GetLeaderboard(new GetLeaderboardRequest {
			StatisticName = identifier,
			Version = scoreVersion,
			ProfileConstraints = new PlayerProfileViewConstraints {
				ShowAvatarUrl = false,
				ShowBannedUntil = false,
				ShowCampaignAttributions = false,
				ShowContactEmailAddresses = false,
				ShowCreated = false,
				ShowDisplayName = true,
				ShowExperimentVariants = false,
				ShowLastLogin = false,
				ShowLinkedAccounts = true,
				ShowLocations = false,
				ShowMemberships = false,
				ShowOrigination = false,
				ShowPushNotificationRegistrations = false,
				ShowStatistics = false,
				ShowTags = false,
				ShowTotalValueToDateInUsd = false,
				ShowValuesToDate = false
			}
		}

Here the code to get the leaderboard. Explicitly set everything as needed at the moment. But instead of both entries in LinkedAccounts it just shows one entry which is the custom ID, so Steam ID even though visible in the player overview won't be loaded for some reason.

0 Likes 0 ·
Xiao Zha avatar image
Xiao Zha answered

Your code works fine in my tests, but I can't reproduce your problem. How you get linked accounts in the API response with your code? Can you share the code snippet with us? And could you please try calling the GetPlayerProfile API or GetLeaderboard API using Postman to see if the Steam account shows up in the linked accounts results?? If not, can you provide your Title ID and your test account for us to investigate?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Daniel Bonrath avatar image
Daniel Bonrath answered
PlayFabClientAPI.GetLeaderboard(new GetLeaderboardRequest {
			StatisticName = identifier,
			Version = (int) scoreVersion,
			ProfileConstraints = new PlayerProfileViewConstraints {
				ShowAvatarUrl = false,
				ShowBannedUntil = false,
				ShowCampaignAttributions = false,
				ShowContactEmailAddresses = false,
				ShowCreated = false,
				ShowDisplayName = true,
				ShowExperimentVariants = false,
				ShowLastLogin = false,
				ShowLinkedAccounts = true,
				ShowLocations = false,
				ShowMemberships = false,
				ShowOrigination = false,
				ShowPushNotificationRegistrations = false,
				ShowStatistics = false,
				ShowTags = false,
				ShowTotalValueToDateInUsd = false,
				ShowValuesToDate = false
			}
		}, result => {
			Debug.Log("Received leaderboard: " + result.Leaderboard.Count);


			foreach (var r in result.Leaderboard) {
				Debug.Log("Player: " + r.DisplayName);


				foreach (var l in r.Profile.LinkedAccounts) {
					Debug.Log("Linked: " + l.Platform + " - " + l.Username);
				}


				PlayFabClientAPI.GetPlayerProfile(new GetPlayerProfileRequest {
					PlayFabId = r.PlayFabId,
					ProfileConstraints = new PlayerProfileViewConstraints {
						ShowAvatarUrl = false,
						ShowBannedUntil = false,
						ShowCampaignAttributions = false,
						ShowContactEmailAddresses = false,
						ShowCreated = false,
						ShowDisplayName = true,
						ShowExperimentVariants = false,
						ShowLastLogin = false,
						ShowLinkedAccounts = true,
						ShowLocations = false,
						ShowMemberships = false,
						ShowOrigination = false,
						ShowPushNotificationRegistrations = false,
						ShowStatistics = false,
						ShowTags = false,
						ShowTotalValueToDateInUsd = false,
						ShowValuesToDate = false
					}
				}, result => {
					Debug.Log("Received profile");
				}, error => {
					Debug.Log("Error receiving profile: " + error.GenerateErrorReport());
				});
			}
		}, error => {
			Debug.Log("Failed getting leaderboard: " + error);
		});

That's my debug code at the moment to get the linked accounts. The GetPlayerProfile was just added to check whether it works with that call instead of GetLeaderboard. StatisticName = "Score-SP", Version = 0. Actually I checked the results with the debugger attached, the output was just on top of that as sometimes Visual Studio tries to trick me.

Title ID: 7E0D1
PlayerID: 106BE1BE3EE5BA98

Postman also just returns the custom ID and not the SteamID

Body of the GetLeaderboard call in Postman (GetPlayerProfile also just custom ID):

{
  "StatisticName": "Score-SP",
  "StartPosition": 0,
  "MaxResultsCount": 20,
  "ProfileConstraints": {
    "ShowLinkedAccounts": 1
  }
6 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Xiao Zha avatar image Xiao Zha commented ·

Just to confirm, can you log in with your Steam ID?

0 Likes 0 ·
Daniel Bonrath avatar image Daniel Bonrath Xiao Zha commented ·

Just tried again to make sure and yes, login via Steam without using the custom ID works as well. The whole API here actually seems super easy to use, so I really don't know what I could do wrong.

0 Likes 0 ·
Xiao Zha avatar image Xiao Zha Daniel Bonrath commented ·

Could you submit a support ticket to us, so that we can help to check some private information of your title.

0 Likes 0 ·
Show more comments
Show more comments
Daniel Bonrath avatar image
Daniel Bonrath answered

Tried with account 500F812F788B3061 and also from that player only the custom ID is queried. That account is linked to Steam as well as PlayStation and Xbox Live accounts (the last two aren't configured for that project yet, so the account was used for our previous game already).

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Xiao Zha avatar image Xiao Zha commented ·

Sorry for the late reply, from your description, it looks like you created a new player account but linked the previous Steam account instead of a new Steam account. If so, were you able to link a new Steam account to test?

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.