question

Stefano Zinna avatar image
Stefano Zinna asked

Title player account ID from master ID

I am trying to get the Title player account ID from Master player account ID. I am using Get Title Players From Master Player Account Ids. I do not know if I am using it correctly and how to get back the Title player ID. Please have a look at it and let me know. Thanks!

     PlayFabProfilesAPI.GetTitlePlayersFromMasterPlayerAccountIds(
         new GetTitlePlayersFromMasterPlayerAccountIdsRequest()
         {
             MasterPlayerAccountIds=new List<string>()
             {
                
                 "MasteerAccountIDXXXXXXXXXXX"
             }
         },
         (result) =>
         {


             Debug.Log("GetTitleID: "+  ??????);

         },
         (error) =>
         {
             Debug.LogError(error.ErrorMessage);
         }
         );
unity3d
10 |1200

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

Stefano Zinna avatar image
Stefano Zinna answered

If someone else is looking for it here is the script in Unity:

  PlayFabProfilesAPI.GetTitlePlayersFromMasterPlayerAccountIds(
      new GetTitlePlayersFromMasterPlayerAccountIdsRequest()
      {
          MasterPlayerAccountIds=new List<string>()
          {
                
              "MasteerAccountIDXXXXXXXXXXX"
          }
      },
      (result) =>
      {
          Debug.Log("GetTitleID: " + result.TitlePlayerAccounts["MasteerAccountIDXXXXXXXXXXX"].Id);
      },
      (error) =>
      {
          Debug.LogError(error.ErrorMessage);
      }
      );
10 |1200

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

Infer Wang avatar image
Infer Wang answered

There is nothing wrong with the Api call, you just need to add the result part. I tested in Postman and the result’s structure is showed in the following picture. You can write code in Unity according to the structure.

6424-image.png


image.png (17.9 KiB)
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.