question

ahmetselimtasaltin avatar image
ahmetselimtasaltin asked

Retrieve Player Data By Email

Hi,

I'm trying to retrieve player title data by email. I want to provide email as input and retrieve the title data of the associated user. It seems I can only retrieve data from the authorized user who has already login-ed. I want to provide email as a user identifier and retrieve the user's player title data of the given key. This is a little bit urgent so please don't hesitate to reply.

Best Regards, Ahmet Selim

Title Datadata
10 |1200

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

Gosen Gao avatar image
Gosen Gao answered

To get a player’s data, you need his PlayFabId as an identifier. You can get it from Client API GetAccountInfo/Admin API GetUserAccountInfo by passing the Email address. There are three kinds of Player Title Data, you can check this document to learn the difference. If you are not retrieving the Internal Data, then you can implement this feature on the client side. But it only works when the data permission set to Public. The work flow should be like this:

  • 1. Get the player’s PlayFabId with API GetAccountInfo.
  • 2. Get the data you want with API GetUserData or GetUserReadOnlyData.

But if you want to retrieve the Internal data, then you need to implement an Azure Function. The work flow should be similar, but you should call GetUserInternalData. You can follow this tutorial to get started with Azure Functions: Quickstart: Writing a PlayFab CloudScript using Azure Functions

2 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.

ahmetselimtasaltin avatar image ahmetselimtasaltin commented ·

Ok, so as far as I understood it is possible to retrieve player data without cloud script/Azure Functions. It would be a lot easier for me. The point I'm stuck on is utilizing GetUserData for a user that hasn't signed in. I can use this function to get users' data but utilizing it to retrieve other people's data is quite troubling for me. I am a newcomer to this environment. I would like to thank you for your prompt response on this issue.

Best Regards Ahmet Selim

0 Likes 0 ·
Gosen Gao avatar image Gosen Gao ahmetselimtasaltin commented ·

As I've mentioned above, to get other players' data, besides the PlayFabId, you need to set the data's permission to Public. PlayFabId is a unique PlayFab identifier of the user to load data for. Defaults to yourself if not set. When specified to a PlayFab ID of another player, then this will only return public keys for that account.

0 Likes 0 ·
1.png (17.9 KiB)
Gosen Gao avatar image
Gosen Gao answered

I don’t quite understand what is your requirement. Do you mean you want to retrieve PlayerTitleData from your personal Database or other services, when players request and pass an Email as an identifier, then you will send the data directly to his Email? If so, I think you need an external Server to handle this. It should have the feature to write/read data from Database, the feature to handle requests and send emails.

If I misunderstand what you require, please feel free to let me know.

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.

ahmetselimtasaltin avatar image ahmetselimtasaltin commented ·

Hi,

I needed to retrieve other player's data in the Playfabs environment but after a brief search, I think I need to set up a Cloudscript-Azure Function that takes email as input and retrieve allocated data of the account that the email is bound to.

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.