HTTP 400 (Bad Request) (Discord Webhook)

try replacing the webhook variable with this -
https://webhook.lewistehminerz.dev/api/webhooks/ rest of webhook here

No, it’s a Normal Script. ------------

How do I send information from the client to the server tho?

This is what I currently have.

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local GreenEvent = ReplicatedStorage:WaitForChild("GreenStatus")
local YellowEvent = ReplicatedStorage:WaitForChild("YellowStatus")
local RedEvent = ReplicatedStorage:WaitForChild("RedStatus")

local HttpService = game:GetService("HttpService")
local Webhook = "https://hooks.hyra.io/api/webhooks/-"

local function GreenStatus(player, Error, PlaceId, ResponseMessage)
	print("✅ | Green Status")	
	local Data =
		{
			["embeds"] = {{
				["title"] = "`" .. Error .. "` is back up!",
				["description"] = "🟢 **" .. Error .. "** has improved performance.",
				["type"] = "rich",
				["color"] = tonumber(0x00FF24),
				["author"] = {
					["name"] = "Gandhi20's Games";
					["url"] = "https://discord.gg/ZrVpP9YySC";
					["icon_url"] = "https://cdn.discordapp.com/avatars/967423351217881118/ea8d182f38950481364896edf8cfe753.webp?size=96";
				},
				["footer"] = {
					["text"] = "Powered by Gandhi20's Games";
					["icon_url"] = "https://cdn.discordapp.com/avatars/967423351217881118/ea8d182f38950481364896edf8cfe753.webp?size=96";
				},
				["timestamp"] = DateTime.now():ToIsoDate(),
				["fields"] = {
					["name"] = "PlaceId";
					["value"] = "```" .. PlaceId .. "```";
					["inline"] = true;
				},
				{
					["name"] = "Status Code";
					["value"] = "```100```";
					["inline"] = true;
				},
				{
					["name"] = "Response Message";
					["value"] = "```" .. ResponseMessage .. "```";
					["inline"] = false;
				}
			}
			}
		}
	wait(1)
	HttpService:PostAsync(Webhook,HttpService:JSONEncode(Data))
end

GreenEvent.OnServerEvent:Connect(GreenStatus)

Make sure the parameters you are sending to the response header are correct.

They are. Let me show you the error that it’s showing now.

I know that there is an error somewhere in the embed section but not sure where…

Not sure if you already did this, but have you turned on the HTTP Services? {Within Settings}

1 Like

its suppose to be jsondecode for the data to be sent to ur discord server

Yes I did. ---------------------

Have you made sure all the formatting is correct? Maybe this post helps: HTTP 400 (Bad Request) error? - #7 by Awesomewebm

The fields key in the embeds is not attached to one table consisting of multiple fields.

		["fields"] = {
            [1] = {
			    ["name"] = "PlaceId",
			    ["value"] = "```" .. PlaceId.Text .. "```",
			    ["inline"] = true
		    },

		    [2] = {
			    ["name"] = "Status Code",
			    ["value"] = "```" .. StatusCode.Text .. "```",
			    ["inline"] = true
		    },

		    [3] = {
			    ["name"] = "Response Message",
			    ["value"] = "```" .. ResponseMessage.Text .. "```",
			    ["inline"] = false
		    }
        }

It looks like you’re using a LocalScript, use a RemoteEvent to the server and put it in a ServerScript, it will work then.

Discord integration no longer works with Roblox. so that’s probably your issue. unless there’s some work around that Im un aware of

That’s what I am doing. ------------

I am using a proxy. --------------

I am actually unaware of what that is. Could you explain?

Proxy server is a server application that acts as an intermediary between a client requesting a resource and the server providing that resource. By using a proxy you can “bypass” the “block”. It’s like another way of catching/sending data.

1 Like