question

An Pham avatar image
An Pham asked

Cant get player display name in LoginWithServerCustomId api

Hello everyone,

It seems like we've encountered a bug. When attempting to call the LoginWithServerCustomId API with the ShowDisplayName parameter (doc), it doesn't return the expected result. 6970-screenshot-2024-04-12-at-154634.png However, when I utilize the GetPlayerProfile parameter, the display name is returned correctly.

Here is my request

 curl --location 'https://{
                 {titleId}}.playfabapi.com/server/LoginWithServerCustomId?sdk=PostmanCollection-0.175.230306' \
 --header 'X-PlayFabSDK: PostmanCollection-0.175.230306' \
 --header 'Content-Type: application/json' \
 --header 'X-SecretKey: {
                 {secret key}}' \
 --data '{
   "ServerCustomId": "whatever_name",
   "CreateAccount": false,
   "InfoRequestParameters": {
     "GetPlayerProfile": true,
     "ProfileConstraints": {
         "ShowDisplayName": true
     }
   }
 }'

Response: 6981-screenshot-2024-04-12-at-155003.png

apis
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

·
Xiao Zha avatar image
Xiao Zha answered

The "GetPlayerProfile" parameter controls whether to obtain the player profile, when it set to true, then you can use the "ProfileConstraints" parameter to specify the properties returned from the player profile. Also, if you just want to get the player's display name, you can just use the "GetPlayerProfile" parameter, since the display name is one of the player profiles returned by default, even if you don't specify "ShowDisplayName" as true in the "ProfileConstraints" parameter.

10 |1200

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

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.