Why does my discord webhook system break?

Okay, here’s some context. There’s a feature in my game where people can submit advertisements with a decal id and a (filtered) title of the ad. To moderate these further, I want a webhook system to monitor any innapropriate decals to report them to roblox, and to ban the members from the game.

The issue is "HTTP 400 (Bad Request)

I’ve tried looking for HTTP 400 but can’t find much info about it, sorry if I’m blind.

More details:
currentInfo.User = userid of player
currentInfo.Decal = decal
currentinfo.Title = ad title
currentinfo.Time = the amount of time the ad played
currentInfo.Username = the username (not display name) of the player

Code:

			local data = {
				['embeds'] = {{
					['title'] = "New advertisement by "..currentInfo.Username,
					['description'] = "Make sure to report this if it's innapropriate!",
					['color'] = 1043474,
					['fields'] = {
						{
						['name'] = "UserID",
						['value'] = currentInfo.User,
						},
						{
							['name'] = "Decal ID",
							['value'] = currentInfo.Decal,
						},
						{
							['name'] = "Title",
							['value'] = currentInfo.Title,
						},
						{
							['name'] = "Time",
							['value'] = "The ad played for "..currentInfo.Time.." seconds!",
						},
						{
							['name'] = "Username",
							['value'] = currentInfo.Username,
						}
					},
					['footer'] = "Luxxe#0001",
					['image'] = "https://thumbnails.rprxy.xyz/v1/assets?assetIds="..currentInfo.Decal.."&size=250x250&format=Png&isCircular=false",
					['thumbnail'] = "https://www.roblox.com/headshot-thumbnail/image?userId="..currentInfo.User.."&width=420&height=420&format=png"
				}}
			}
			local finaldata = http:JSONEncode(data)
			http:PostAsync(url, finaldata)

Thanks for helping, and let me know if you need more info!

If you look at the docs, the footer, image, and thumbnail are objects with their own fields, so they should look something like this:

['footer'] = {
	['text'] = "Luxxe#0001",
},
['image'] = {
	['url'] = "https://thumbnails.roblox.com/v1/assets?assetIds="..currentInfo.Decal.."&size=250x250&format=Png&isCircular=false",
},
['thumbnail'] = {
	['url'] = "https://www.roblox.com/headshot-thumbnail/image?userId="..currentInfo.User.."&width=420&height=420&format=png",
}
1 Like

Thank you so much! It works now.