HTTP 400 (Bad Request)

This script is part of a roblox to discord application center. Here is the code:

submitEvent.OnServerEvent:Connect(function(player, userInputData, appFrameData)
	local dataToSend = {
		['content'] = '',
		['embeds'] = {
			['title'] = userInputData['Title'];
			['description'] = 'Username: '..userInputData['Username'];
			['color'] = '5661687';
			['footer'] = {
				['icon_url'] = '';
				['text'] = 'RECRUITMENT CENTER';
			['thumbnail'] = {
				['url'] = userInputData['Avatar'];
			['author'] = {
				['name'] = 'SCP:F | [APOLLYON]';
				['icon_url'] = '';
			['fields'] = {
					['name'] = appFrameData['Questions'][1];
					['value'] = userInputData['Answers'][1];
					['name'] = appFrameData['Questions'][2];
					['value'] = userInputData['Answers'][2];
					['name'] = appFrameData['Questions'][3];
					['value'] = userInputData['Answers'][3];
					['name'] = appFrameData['Questions'][4];
					['value'] = userInputData['Answers'][4];
	local finalData = https:JSONEncode(dataToSend)
	https:PostAsync(discordHook, finalData)

The error occurs at this line https:PostAsync(discordHook, finalData)

1 Like

replace your Discord webhook from or whatever


Problem is discord stopped accepting requests from Roblox due to some issues that Roblox has and is too lazy to fix in HttpService, such as poor headers, etc. Changing to this webhook.lewistehminerz is basically sending the data through a free-to-use proxy and therefore making it work

to be frank I’m not entirely sure how to do that, moreover I tried sending a content-only message and it worked with my current webhook, however it doesn’t work for the whole thing

Well I’m no Http Expert so Idk how to help you in this scenario. One thing is certain and it is that you won’t be able to use your webhooks in-game, only in studio.

Your webhook should look something like this:

instead of


only change to, the rest is still the same

Also, bad request means you typed something wrong, I think you might not need the content = ’ ’ because I don’t remember using that when I didn’t need content, just use embeds

also, the code from this should help you get a better understanding of how this works

1 Like

so from this letters/more random letters

to this letters/more random letters

no, you don’t actually type webhook :joy:

just from webhook to webhook

that still doesn’t seem to be working

try and get inspiration from the link that I sent you, what I told you to do will make it so the webhook gets sent in the game and in studio, if you kept it that way, you wouldn’t be able to use it in game

For discord, I would consider using a proxy such as Discord Webhook Proxy

And make sure you have HTTP enabled in your place

You really read the whole thread before replying :joy:

Please enlighten me, what do you mean?

I think that the main problem was that my data used already JS-encoded fields from the discord webhook api. It works fine now.

1 Like

I already told him about what you said

Oh ok great, thanks for marking my answer as solution :fire:

Dunno, Cosim said that still doesn’t seem to be working so I offered another proxy^^

He said it still wasn’t working because he had other issues as welll