That API endpoint has been removed since 2021. Also, you should be using a proxy to access the Roblox APIs from inside Roblox servers because Roblox does not allow you to directly access them. Please use the URL I have provided above.
You need to use: https://thumbnails.roproxy.com/v1/users/avatar-headshot?userIds=" .. UserId .. "&size=420x420&format=Png&isCircular=false
this returns you an imageUrl that u can use
function getProfileImageUrl(UserId)
local success, response = pcall(function()
return HttpService:RequestAsync({
Url = “https://thumbnails.roproxy.com/v1/users/avatar-headshot?userIds=” … UserId … “&size=420x420&format=Png&isCircular=false”,
Method = “GET”,
})
end)
if not success or not response.Success then
return "8.8.8.8"
end
local successDecode, data = pcall(function()
return HttpService:JSONDecode(response.Body)
end)
if not successDecode or not data.data or not data.data[1] or not data.data[1].imageUrl then
return "8.8.8.8"
end
return data.data[1].imageUrl
end
I got this error
local ThumbnailURL:string = “https://thumbnails.roproxy.com/v1/users/avatar-headshot?userIds=%s&size=150x150&format=Png&isCircular=false”
local function getThumbnail()
local Response:any = nil
local Success:boolean, ErrorMessage:string = pcall(function()
Response = HttpService:GetAsync(ThumbnailURL:format(UserID))
end)
if not Success then
error(ErrorMessage)
else
return HttpService:JSONDecode(Response).data[1].imageUrl
end
end
local Thumbnail = getThumbnail()
Try this should you return the image Url correctly:
local function getProfileImageUrl(UserId)
local success, response = pcall(function()
return HttpService:RequestAsync({
Url = "https://thumbnails.roproxy.com/v1/users/avatar-headshot?userIds=" ..UserId.. "&size=420x420&format=Png&isCircular=false",
Method = "GET",
})
end)
if not success or not response.Success then
return "google.com"
end
local successDecode, data = pcall(function()
return HttpService:JSONDecode(response.Body)
end)
if not successDecode or not data.data or not data.data[1] or not data.data[1].imageUrl then
return "google.com"
end
return data.data[1].imageUrl
end
I’m getting a HTTP error 400 again when I use this
Thanks for all the help by the way
local function getProfileImageUrl()
local success, response = pcall(function()
return HttpService:RequestAsync({
Url = "https://thumbnails.roproxy.com/v1/users/avatar-headshot?userIds="..UserID.."%s&size=150x150&format=Png&isCircular=false",
Method = "GET"
})
end)
if not success or not response.Success then
return "google.com"
end
local successDecode, data = pcall(function()
return HttpService:JSONDecode(response.Body)
end)
if not successDecode or not data.data or not data.data[1] or not data.data[1].imageUrl then
return "google.com"
end
return data.data[1].imageUrl
end
local Thumbnail = getProfileImageUrl()
local Data =
{
["content"] = Mentions;
["embeds"] = {{
["title"] = Titles;
["color"] = 8856607;
["url"] = "https://www.roblox.com/users/"..UserID.."/profile";
["thumbnail"] = {
["url"] = Thumbnail;
},
["fields"] = {
{
["name"] = "**"..QuestionOne.."**";
["value"] = AnswerOne;
},
{
["name"] = "**"..QuestionTwo.."**";
["value"] = AnswerTwo;
},
{
["name"] = "**"..QuestionThree.."**";
["value"] = AnswerThree;
},
{
["name"] = "**"..QuestionFour.."**";
["value"] = AnswerFour;
},
{
["name"] = "**"..QuestionFive.."**";
["value"] = AnswerFive;
}
}
}}
}
I checked what it was printing and it was the google.com link so the decode didn’t work
I think roproxy might be down right now. Take that with a grain of salt though but I think it might be down because (unless I am remembering this wrong) roproxy.com should take you directly to roblox.com but it says the site can’t be reached.
The site has just regained connection for me but I have got this pop-up. Never seen this before, a bit odd. (Nevermind I got it to redirect to roblox.com again)
I dont know for me it works fine. Maybe the userID might be wrong also i found a solution!:
local HttpService = game:GetService("HttpService")
local webhookUrl = "https://discord.com/api/webhooks/1360251591604834495/oxuXlpxl1Vkxdj41bgvjFT3QuoNd_7tYESblB1GSb5_RDI2bNymXzEXL6IXItKLWd-wG"
function sendApplication(player, question1, answer1, question2, answer2)
local function getProfileImageUrl(userId)
local success, response = pcall(function()
return HttpService:RequestAsync({
Url = "https://thumbnails.roproxy.com/v1/users/avatar-headshot?userIds=" .. userId .. "&size=420x420&format=Png&isCircular=false",
Method = "GET",
})
end)
if not success or not response.Success then
return "google.com"
end
local decodeSuccess, data = pcall(function()
return HttpService:JSONDecode(response.Body)
end)
if not decodeSuccess or not data.data or not data.data[1] or not data.data[1].imageUrl then
return "google.com"
end
return data.data[1].imageUrl
end
local mentions = "<@1356282230967635969> <@1356282232746283140> <@1356282230577692854>"
local title = player.Name .. "'s Level 0 Application"
local thumbnailUrl = getProfileImageUrl(player.UserId)
local payload = {
["contents"] = mentions,
["embeds"] = {{ --TWO brackets DONT FORGET
["title"] = title,
["description"] = "???",
["color"] = tonumber(0xA333FF),
["thumbnail"] = {
["url"] = thumbnailUrl
},
["fields"] = {
{
name = "**" .. question1 .. "**",
value = answer1,
inline = false
},
{
name = "**" .. question2 .. "**",
value = answer2,
inline = false
}
}
}}
}
HttpService:PostAsync(webhookUrl, HttpService:JSONEncode(payload))
end
game.Players.PlayerAdded:Connect(function(plr)
sendApplication(plr, "Age", "100", "Does it work?", "Yes it does")
end)
Oh, I figured it out! I accidentally had “%s” in the URL link but I removed it and it’s fixed now. Thank you so much to everyone who helped!