question

Ozan Yilmaz avatar image
Ozan Yilmaz asked

Is There A Way To Get Playfab ID By Display Name?

Hello everyone,

I want to implement a feature to send a virtual currency to the another players in the game. I was wondering if there is a way to get Playfab ID by display name via cloudscript?

I will take display name and the amount as parameters from the player.

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.

Ozan Yilmaz avatar image Ozan Yilmaz commented ·

Bump. No solutions at all?

0 Likes 0 ·
brandon@uprootstudios.com avatar image brandon@uprootstudios.com Ozan Yilmaz commented ·

@Ozan Yilmaz I don't think this is possible as you'd likely have to iterate through all players to find the one you're looking for. What's your use case?

0 Likes 0 ·

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

Admin API GetUserAccountInfo and Client API GetAccountInfo can be used to retrieve the relevant details for a specified user, based upon a match against a supplied unique identifier. You can click the link to check the API of it, “Email”,”PlayFabId”,”TitleDisplayName”,”Username” all can be used as the unique identifier. So, you can get one player’s PlayFabId via the player’s Displayname.

Admin API and Client API cannot be accessed by CloudScript directly. You can call Admin API from a custom game server, exactly as you do any Server API method. Just be very careful about usage - the Admin API is meant to be used for tools and general game configuration. If it's being called at a higher rate, due to servicing player calls, that would result in hitting the API rate limit.

Client API GetAccountInfo can be a workaround for your case, if you use this API you need to call it on clients directly instead of via CloudScript.

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.

Ozan Yilmaz avatar image Ozan Yilmaz commented ·

Thank you for the answer

0 Likes 0 ·
Dominic Hamelin-Blais avatar image Dominic Hamelin-Blais commented ·

Work great, thanks!

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.