Open cloud returns "Scope not authorized"

local function getViaKeywords(keywords: string, searchType: string)	
	if searchType == "Video" then
		local url = `https://apis.roblox.com/toolbox-service/v2/assets:search?searchCategoryType={searchType}&query={HttpService:UrlEncode(keywords)}`

		local success, data = pcall(HttpService.RequestAsync, HttpService, {
			Url = url,
			Method = "GET",
			Headers = {
				["x-api-key"] = HttpService:GetSecret("Toolbox"),
				["Content-Type"] = "application/json"
			}
		})

		if not success then warn(data, url) end
		data = success and HttpService:JSONDecode(data.Body) or {}

		return data
	else
		return {}
	end
end

Does anyone know why the toolbox is return not authorized? The secret has asset:read

It takes no effort to look at the documentation for that endpoint and discover its scope is creator-store-product:read, not asset:read

2 Likes

okay thank u mr smarty it works

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