question

ann avatar image
ann asked

Get inventory for another user in EconomyV2

I'm trying to get the items for another user in Economy V2. I'm looking at the API policy and there doesn't seem to be any deny rules for the inventory/GetInventoryItems endpoint - in fact, there's an allow all rule:

             {
                 "Resource": "pfrn:api--/Inventory/*",
                 "Action": "*",
                 "Effect": "Allow",
                 "Principal": "*",
                 "Comment": "The default allow all inventory APIs statement."
             },

I'm able to get my own title player account's inventory fine, and the Get Inventory operation is Player allowed on the policy page for EconomyV2, but if I try to request the inventory of another user, I get a 401:

 {
     "code": 401,
     "status": "Unauthorized",
     "error": "NotAuthorized",
     "errorCode": 1089,
     "errorMessage": "NotAuthorized"
 }

Is there any way to allow User A to view User B's inventory in Economy V2?

Player Inventory
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

Enable the “Player” policy for GetInventoryItems means the player can get his own inventory. If you want to get other players’ inventory you can use PlayFab CloudScript using Azure Functions - PlayFab | Microsoft Learn to call Inventory - Get Inventory Items - REST API (PlayFab Economy) | Microsoft Learn with a title level entity token.

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.