Inventory API results 403

Hi all,

I am trying to use Inventory Api to a users inventory with PHP. However it keeps returning the following:
Failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden

My PHP code:

echo file_get_contents("".$_GET['userid']."/inventory?assetTypes=Decal&limit=10&sortOrder=Asc")

replacing $_GET[‘userid’] with any ID returns the same result

I also tried the UserSearch api:!/UserSearch/get_v1_users_search and that worked perfectly fine.
Does anyone know whether Inventory Api is not for public use, or I am doing something wrong?

If the user’s inventory is private, it’ll return the error. Alongside with “insufficient permission”.

1 Like

I tested it with my own account which was on public

Could you share the UserId of your other account?

Your inventory on your account is private.

1732783996 this is theeeeee id

Even if the ID I used were private, it should still return json, no error in the PHP

The id you posted worked for me with no error

The error occurs on the php server