How do I get a table of a player or group’s created decals?

Title says it all. If anyone can help I’d appreciate it.

Do you mean all the “Decals” somebody has uploaded to Roblox?

Yes, sorry typo. I’ll fix it right now

You could look through the target player’s inventory using the API. Someone made a great tutorial on how to use the API here:

Although this code should do the trick, I still highly advise you on reading the tutorial itself.

-- Server
function GetDecals()
	local Table = "https://inventory.roproxy.com/v2/users/"..player.UserId.."/inventory?assetTypes=Decal&limit=100&sortOrder=Asc"
	local DecalResponse = HttpService:RequestAsync({
		Url = Table,
		Method = "GET"
	});
	if DecalResponse.Success then
		local TableBody = HttpService:JSONDecode(DecalResponse.Body)
		for i, v in pairs(TableBody) do
			return v
		end
	end	
end

-- The code below just prints it

local Decals = GetDecals()
if Decals ~= nil then -- Avoid errors
	for i, v in pairs(Decals) do
		print(v.name, v.assetId) -- Q: It wasnt "Name?"   A: Not here
	end
end
1 Like

Hello, in studio is works pretty much every time.
In game, it only works sometimes.

I keep getting an error
“Invalid redirect”

Is there any other way to this without HttpService?

You can also use the developer toolbox API for this if you’re looking for public decals and that user has their inventory locked(so the other method doesn’t work):

local function encodeParams(params: {[string]: number | boolean | string}): string
	local result = {}
	for k, v in pairs(params) do
		table.insert(result, k.."="..game.HttpService:UrlEncode(tostring(v)))
	end
	return table.concat(result, "&")
end

local function getUserDecals(userId: number): {number}
	--proxy this
	local url = "https://apis.roblox.com/toolbox-service/v1/marketplace/13"
	--if you want it to return more than 30 use iterative methods with limit, pageNumber
	local params = {
		limit = 30,
		pageNumber = 0,
		keyword = "",
		creatorType = 1,
		creatorTargetId = userId,
		includeOnlyVerifiedCreators = false,
		querySource = 0
	}
	--pcall this
	local response = game.HttpService:GetAsync(url.."?"..encodeParams(params))
	local data = game.HttpService:JSONDecode(response)
	local ids = {}
	for _, v in pairs(data.data) do
		table.insert(ids, v.id)
	end
	return ids 
end

By running getUserDecals(ID) you get a list of decal ids distributed to the developer marketplace by that user.

1 Like

Is there a way to do this but for groups?