question

Dave W avatar image
Dave W asked

Can we search for an account based on a Linked Email using "GetAccountInfo"?

Hi there,

We have an application that allows users to link their Google account (LinkGoogleAccount). In the game manager console (https://developer.playfab.com/en-us/r/t/TITLE_ID/players), we can search for players based on their Google accounts that have been linked. When we search on the same email with "GetAccountInfo" , it does not return however.

I'm guessing the GetAccountInfo call only searches on the contact email or master player email if they've used that for their authentication method.

Is there any way in the Admin API to search for emails by their linked accounts, so someone who has linked via Google will be returned, similar to how the game manager works?

Thanks! Dave

Player DataTitle Data
10 |1200

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

1 Answer

·
Xiao Zha avatar image
Xiao Zha answered

GetAccountInfo API use master player account email to get player’s account info. And playfab doesn’t provide such feature for you to use API to search a player with linked account email. You may post a feature request for it.

As a workaround, when players link google account, you may use AddGenericId API (https://learn.microsoft.com/en-us/rest/api/playfab/client/account-management/add-generic-id?view=playfab-rest) to match the PlayFabId with the Google email prefix (set the UserId parameter with the processed linked Google account email address prefix). Then when a player enters a google email address to search other player, you could process the email address first, then call GetPlayFabIDsFromGenericIDs API (https://learn.microsoft.com/en-us/rest/api/playfab/client/account-management/get-playfab-ids-from-generic-ids?view=playfab-rest) with the processed email address pre-fix to get the PlayFabId, then call GetAccountInfo with the PlayFabId to get the player’s info.

Also, you may try using the GetPlayFabIDsFromGoogleIDs API (https://learn.microsoft.com/en-us/rest/api/playfab/client/account-management/get-playfab-ids-from-google-ids?view=playfab-rest) and set GoogleId parameter to PlatformUserId. Then use the obtained PlayFabID to call the GetAccountInfo API. Regarding how to allow players to obtain the PlatformUserId of other players through google email, since we are not experts in Google, you can consult Google for professional help.

10 |1200

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

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.