question

drmike avatar image
drmike asked

How to go from UGC CreatorID to a display name?

I've got a question about player Ids and User Generated Content items.

When I log in, I get a PlayFabID for myself as a player (which can span multiple titles?), and also a EntityToken.EntityID which is different (only applies to this title?).

The PlayFabId is the one visible on the list of players in the Game Manager dashboard, and the EntityID matches the Player ID (title) seen when we click on that player in the Game Manager to get their details.

I can pass the PlayFabID to GetPlayerProfile in order to get my own display name.

Cool! So far so good...

When I get a UGC Item I've made, via a GetItem call, it has the EntityToken.EntityID value attached to it as the Item.CreatorEntity.Id. It doesn't have the creator's PlayFabId anywhere.

I'd like to display the user name of the player's who created each item in my UGC browser UI.

Can I use the EntityID to get a display name for the player who created that item, and if so how?

eg is there a call to pass the EntityID and receive the PlayFabID (to then pass into GetPlayerProfile), or something even more direct than that?

Player 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

·
Gosen Gao avatar image
Gosen Gao answered

-- When I log in, I get a PlayFabID for myself as a player (which can span multiple titles?), and also a EntityToken.EntityID which is different (only applies to this title?).

Please refer to Available built-in entity types to learn more about the PlayFabId and the entity id.

-- Can I use the EntityID to get a display name for the player who created that item, and if so how?eg is there a call to pass the EntityID and receive the PlayFabID (to then pass into GetPlayerProfile), or something even more direct than that?

You can use API GetProfile to get the PlayFabId(master_player_account) by passing the Entity(Id and Type) and then use API GetPlayerProfile to get the DisplayName. Also, when you create the item, you can add the creator’s display name to the UGC item’s Description or DisplayProperties so that you can get it without other API calls.

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.

drmike avatar image drmike commented ·

Awesome! Thanks so much for that.

Adding their username to the DisplayProperties on upload looks like the right solution for us.

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.