You can use GetAccountInfo
https://api.playfab.com/documentation/client/method/GetAccountInfo
API can accept the PlayFabId, OR the name, OR the username, OR the email, and will return both the PlayFabID and the title_player_account as well.
Because it says there that the playfabId is the required parameter to use this function, and the parameter I can provide is the displayname only. Can you please give me an example?
Client/GetAccountInfo (the linked API call, above) does not have PlayFab ID as a required parameter. If you believe you're seeing something different, can you reply with the link to the doc page in question?
We have a number of samples available here: https://github.com/PlayFab/PlayFab-Samples. Specific to GetAccountInfo, there's actually an old post with an example of using the call to get the local player's info here: https://community.playfab.com/questions/115/205469398-Show-User-There-Playfab-ID.html. The only change for the case of using it to get a player's info via their Title Display Name would be the addition of setting that parameter (TitleDisplayName) in the request object.
Hello Brendan, I don't understand why GetUserAccountInfo doesn' work as GetAccountInfo.
I need to get other player's playfab ID using display name but server side..via cloud script.
Thanks you
They were made for very different purposes - server versus client usage. Basically, the server normally has the PlayFab ID already, where the client needed other lookup methods for cases where the player is manually entering a name or email address for lookup.
Can you describe the gameplay scenario you are trying to build? What is the context in which the client has display name without PlayFab ID, and where you don't want the client to query for the PlayFab ID of the other user.
Hello Brendan,
I want to execute a cloud script from client as following :
PlayFab::ClientModels::ExecuteCloudScriptRequest myRequest;
myRequest.FunctionName = "MyScript";
myRequest["FriendDisplayName"] = "toto 234";
With this FriendDisplayName, I want the cloud script to retrieve the FriendPlayfabID and push a key value into its userinternalData. The cloud script must be in charge of all.
My problem is that I can't send the FriendPlayfabID with my cloud script request except if I first throw another request to get the playFabID via GetAccountInfo.
If i break down the process into 2 steps, it works, but i was just wonderning if it could be possible to make it in 1 step.
Thank you
With the API as it is today, no, it's going to require two steps. This isn't the only case where it might be nice to have more overlap in functionality between the client and server. That's an error we're looking to improve over time. The updated entity API is a start in that direction. I've made a specific note to look into some functionality to do player PlayFabId lookups from the server.
5 People are following this question.