question

gamedev-1 avatar image
gamedev-1 asked

Getting /Server/GetUserInventory: HTTP/1.1 400 Bad Request

my code:

public void GetPlayFabInventory()
        {
            //PlayFabClientAPI.GetUserInventory(new GetUserInventoryRequest(), LogSuccess, LogFailure);
            PlayFabServerAPI.GetUserInventory(new PlayFab.ServerModels.GetUserInventoryRequest { PlayFabId = userIDString },
                result =>
                {
                    result.Inventory.ForEach(item => Debug.Log(item.ItemInstanceId + " : " + item.DisplayName));
                },
                error => { Debug.LogError(error.GenerateErrorReport()); });
        }

So I have this issue, running the code fine on my server, I have enabled Server API in the plugin which successfully has all my titles info/secrets, and client connects fine with playfab and can make purchase and everything.

Is there anything I need to do on my server side to have access to these API calls ?

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

·
Seth Du avatar image
Seth Du answered

According to the error it is caused by the request being incorrect.

The server API GetUserInventory will require a Master Player Account ID, which is also named PlayFab ID. May I ask are you using a title_player_account ID? In addition, if the Master Player Account ID doesn’t exist, the same error will also be prompted in my testing project.

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.

Izhar Mishli avatar image Izhar Mishli commented ·

In my case I am forced to use TitleId as its whats being returned from OnRemotePlayerJoined (PlayFab party), is there a way to acquire Master Player Account ID byTitleID?

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Izhar Mishli commented ·

Please do not post non-relevant questions in a closed thread.

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.