Http 404 error, does not find a path that is correct

Hey. I am writing an HttpService API (to make things easier when I work), I am currently working on an Avatar Headshot API (I don’t like to use Roblox’s one), but it errors in the output: ‘Http 404 (Not Found)’.
This is the code that I’ve written so far:

--[[
	Module.new(player) --> Self {class}
	Self:GetAvatarData() --> State {boolean}, Data {table}
	Self:GetFollowingsCount() --> State {boolean}, Data {integer}
	Self:GetFriendsCount() --> State {boolean}, Data {integer}
	Self:GetAvatarHeadshot(size) --> State {boolean}, Data {string}
--]]

local httpService = (game:GetService("HttpService"));
local httpApi = {}
httpApi.__index = httpApi

function httpApi.new(player)
	assert(not (player == nil), "Argument 'player' is equal to nil.")
	assert(typeof(player) == "Instance", string.format("Argument 'player' expected to be player, got %s", typeof(player)))
	assert(player:IsA("Player"), "Argument 'player' is not a player.")
	return setmetatable({Player = player}, httpApi)
end;

function httpApi:GetAvatarData()
	local url = ("https://avatar.rprxy.xyz/v1/users/".. self.Player.UserId.. "/avatar");
	return pcall(function()
		local body = (httpService:JSONDecode(httpService:GetAsync(url)));
		return body
	end)
end;

function httpApi:GetFollowingsCount()
	local url = ("https://friends.rprxy.xyz/v1/users/".. self.Player.UserId.. "/followings/count");
	return pcall(function()
		local body = (httpService:JSONDecode(httpService:GetAsync(url)));
		return body.count
	end)
end;

function httpApi:GetFriendsCount()
	local url = ("https://friends.rprxy.xyz/v1/users/".. self.Player.UserId.. "/friends/count");
	return pcall(function()
		local body = (httpService:JSONDecode(httpService:GetAsync(url)));
		return body.count
	end)
end;

function httpApi:GetAvatarHeadshot(size)
	assert(not (size == nil), "Argument 'size' is equal to nil.")
	assert(typeof(size) == "string", string.format("Argument 'size' expected to be string, got %s", typeof(size)))
	local url = ("https://thumbnails.rprxy.xyz/v1/users/".. self.Player.UserId.. "/avatar-headshot");
	return pcall(function()
		local body = (httpService:JSONDecode(httpService:GetAsync(url))); -- // Error here, the path is not found.
		return body
	end)
end;

return httpApi

The error appears in the last function in the ModuleScript. Any help would be appreciated.
Edit: Here is a link to the API source https://thumbnails.roblox.com/docs#!/Avatar/get_v1_users_avatar_headshot

The request you sent was invalid, you need to send a request to this endpoint below

https://thumbnails.rprxy.xyz/v1/users/avatar-headshot?userIds=125800500&size=48x48&format=Png&isCircular=false

And of course, you have to replace 125800500 with the player user id

1 Like

Thanks! I also thought about how would I pass this information as it didn’t seem possible without specifying it within the url, that answered all my questions.

1 Like