Mishaho
(Mishaho)
August 13, 2021, 2:36pm
#1
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:
<?php
echo file_get_contents("https://inventory.roblox.com/v2/users/".$_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: https://users.roblox.com/docs#!/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?
Doqee
(Doqee)
August 13, 2021, 2:38pm
#2
If the user’s inventory is private, it’ll return the error. Alongside with “insufficient permission”.
1 Like
Mishaho
(Mishaho)
August 13, 2021, 2:48pm
#3
I tested it with my own account which was on public
Razor_IB
(spoodr)
August 13, 2021, 3:09pm
#4
Could you share the UserId of your other account?
Your inventory on your account is private.
Mishaho
(Mishaho)
August 13, 2021, 3:19pm
#6
1732783996 this is theeeeee id
Mishaho
(Mishaho)
August 13, 2021, 3:20pm
#7
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
Mishaho
(Mishaho)
August 13, 2021, 3:22pm
#9
The error occurs on the php server