Parameters from Remote Event not working on External API

Hi, I’m currently working on a catalog searching system that allows players to select a category, sub category, keyword etc. Since all of that is being handled on the client I use a remove event to fire a function in a Catalog module (using the External Catalog API) I’ve made to search for catalog with the current parameters (passed from the client, now on server) and return the result.

Module Function

function module.Search(category,sub ,Keyword, Limit, cursor)
	print(category)
	local url = "https://catalog.roproxy.com/v1/search/items/details?Category="..tostring(category).."&Subcategory="..tostring(sub).."&Keyword="..tostring(Keyword).."&Limit="..tostring(Limit)
	
	if cursor then
		url = url .. "&Cursor="..tostring(cursor)
	end
	
	local response = HTTPService:GetAsync(url)
	local decode = HTTPService:JSONDecode(response)
	
	return decode
end

Server Catching Remove Event

game.ReplicatedStorage.Events:WaitForChild("SearchCatalog").OnServerEvent:Connect(function(player, c, s, k, l, cursor)
	Catalog.Search(c, s, k, l, cursor)
end)

Client Calling the event

----Catalog Searching----
local event = game.ReplicatedStorage.Events:WaitForChild("SearchCatalog")
--Catagory, sub, keyword, limit, cursor
event:FireServer(1,54,"meme",30, nil)

Although I’m receiving the HTTP 400 (Bad Request) error, I’ve tried replacing the parameters when calling the function (on the server) with pre-set ones that are not being passed from the client and everything works fine. My theory right now is that HTTP service does not accept values from the client, although I’m unsure of a work around.

Before making the GET request add print(url) what’s the output?

1 Like
https://catalog.roproxy.com/v1/search/items/details?Category=1&Subcategory=54&Keyword=meme&Limit=30

All the categories are filled as they should

Try using
https://search.roproxy.com/catalog/json?Category=1&Subcategory=54&Keyword=meme&Limit=30

What category/subcategory are you trying to search?

image

I’m currently using the Marketplace API not the Creator Store API (scroll down further in the doc to find it).

And to answer your previous response, the url returns a blank table.

This should work

https://catalog.roproxy.com/v1/search/items/details?Category=11&Subcategory=54&Keyword=meme&Limit=30

Thank you, this did work. Looks like some of the categories (such as 0, 1, etc) don’t work for the link unless I’m using them incorrectly.

Thanks again.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.