Https Error 400 (bad request) [need help!]

so i was trying out some code with a webhook
but i couldnt get farther then this…

someone please help!

local d = {
		['embeds'] = {{
			['title'] = "Name: "..p.Name,
			['description'] = {
				"UserID: "..p.UserId,
				"GraphicID: "..get,
				"GroupRank: "..p:GetRankInGroup(group_ID),
				"DisplyNme: "..p.DisplayName,
				"AcountAGE: "..p.AccountAge
			}
		}}
}
local D = https_S:JSONEncode(d)
https_S:PostAsync(URL1, D)

i tested it without the description and it worked
I dont know the format of it though…

Edit: yes i know there are some spelling mistakes, those are intentional.
Edit2: i found this link to an embed visualizer, but im to stupid to figure it out… https://embed.discord.website/
edit3: Better title, old one was bad

1 Like

Perhaps you should check the RoProxy documentation and make sure your request matches what the request should look like. An HTTP 400 error means that RoProxy (the server) didn’t understand your request perhaps the syntax is wrong.

1 Like

it is, the description is wrong, but i dont know what to do about it…

edit: so yes you are right, but i cant find how to fix it.

Well I don’t really use HTTPService that much so I’m not sure. Perhaps when someone else comes along they can help you further. Sorry.

1 Like

Did you turn on HTTP Requests in Studio?

yes, again, its the description that doesnt have the right format. I pointed this out below the code field

After a debate with Chatgpt i have managed to find a solution!
ive used this format:

local d = {
			embeds = {{
				title = p.Name,
				color = 0x90EE90,  -- Light-green color
				fields = {
					{ name = "Display Name", value = p.DisplayName, inline = false },
					{ name = "Graphic ID", value = get, inline = false },
					{ name = "UserID", value = tostring(p.UserID), inline = false },
					{ name = "Group Rank", value = tostring(p:GetRankInGroup(group_ID)), inline = false },
					{ name = "Account Age", value = tostring(p.AccountAge), inline = false }
				}
			}}
		}
		if SendtoDiscord == true then
			local D = https_S:JSONEncode(d)
			https_S:PostAsync(URL1, D)
		end

have a great day, ill mark this as the solution.

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