How do I get all audios of a player's inventory?

Hi there, I have a music game and currently I’m using Monstercat’s audio in my game. The issue is, is that I’m trying to make it so that I can get all of the audios under the player and insert it into a table. When I try to use the API for getting assets of a user, I get the error HttpError: InvalidRedirect.

Attempt:

local httpsservice = game:GetService("HttpService")
local url = "https://roproxy.com/users/inventory/list-json?assetTypeId=11&cursor=&itemsPerPage=100&pageNumber=%25x&sortOrder=Desc&userId=" -- the url I kept in tutorial
-- also make sure you remove the userid which is in the link if any
local assetid = {3} -- t shirt assets,shirts and pants

local id = 1750384777

local linkforplayer = url..id -- we add the userid to the link
local datafromlink = httpsservice:GetAsync(linkforplayer,true) -- second argument is cache, I kept it true because its needed for this system
-- the data we get from the link is in JSON format so we have to decode it to lua
local readabledata = httpsservice:JSONDecode(datafromlink)
print(readabledata)
1 Like

Hello!

This is a very late response and I’m sure by the time I’ve replied you have already found a solution.
But in case you haven’t (or if there’s people searching for the same thing), here’s a working script.

local HttpService = game:GetService("HttpService")

local id = 1750384777

local url = "https://inventory.roproxy.com/v2/users/"..id.."/inventory/3?sortOrder=Asc&limit=100"

print(HttpService:JSONDecode(HttpService:GetAsync(url)))

I myself wanted to achieve the same thing and found a solution, however I came across this post while searching for it. So here you go!

Source

Yeah haha, did actually find a solution way long ago but sure!