question

wisitnik avatar image
wisitnik asked

Is there a way to get PlayfabID from username using Cloudscript?

Right now GerUserAccount seem the only thing can get PlayfabID but it require PlayfabID and no Username option, or maybe I miss something?

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

·
Joshua Strunk avatar image
Joshua Strunk answered

I don't think your missing anything.

It appears you can not call Server.GetUserAccountInfo with a Username like you can Admin.GetUserAccountInfo which is a little odd. I believe this makes it impossible to with just Cloud Script get a user's PlayFabId with only their Username.

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.

brendan avatar image brendan commented ·

Correct. In the Admin API set, the thinking was that it would be needed for customer service tools you run. But in a server, you would normally have the player's PlayFabId already, either by it being the ID of the client connecting to the server (or calling the Cloud Script, in this case), or an ID the client sends in the query. The only context in which the client doesn't have a PlayFab ID should be when it's a username or email address entered by the player for a lookup, which can be done on the client.

0 Likes 0 ·
wisitnik avatar image wisitnik brendan commented ·

thanks for reply, right now I used client to lookup like just suggested and then do other stuff. It's just 2 steps and little slow (about 2 sec). I try to use this for view some friend's status. maybe I should change from store friend username to playfabid.

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.