HTTP 400 (Bad Request)

So i’m trying to create a webhook going to my discord server sending info about someone who joined. I use https://hooks.hyra.io so it should work. The service allows to send roblox info to discord.

Could anyone please have a look why i’m getting the error Http 400 (Bad Request)

Script:

local webhook = "https://hooks.hyra.io/api/webhooks/removedforsafety"

local Players = game:GetService("Players")

local http = game:GetService("HttpService")

game.Players.PlayerAdded:Connect(function(plr)
	local userId = plr.UserId
	local thumbType = Enum.ThumbnailType.HeadShot
	local thumbSize = Enum.ThumbnailSize.Size420x420
	local content, isReady = Players:GetUserThumbnailAsync(userId, thumbType, thumbSize)
	
	local luaData = 
		{
			["embeds"] = {
				{
					["title"] = plr.Name,
					["url"] = "https://www.roblox.com/users/"..plr.UserId,
					["color"] = 8380233,
					["fields"] = {
						{
							["name"] = "Rank:",
							["value"] = "Racer"
						},
						{
							["name"] = "User Id:",
							["value"] = plr.UserId
						},
						{
							["name"] = "Game:",
							["value"] = game.Name
						}
					},
					["footer"] = {
						["text"] = "Joinlogger V1",
						["icon_url"] = "https://cdn.discordapp.com/attachments/843187749976670228/969990472703561748/NK_logo.png"
					},
					["thumbnail"] = {
						["url"] = content
					}
				}
			}
		}

	http:PostAsync(webhook,  http:JSONEncode(luaData))
end)

Anything is appreciated. Thank you.

Boost, please help. I really need it.

  1. DO NOT USE DISCORD AS A LOGGING SYSTEM. Discord doesn’t allow you to use webhooks for logging purposes, it is against its TOS.
  2. read the documentation. The first parameter to PostAsync is the URL and not the data so you will need to invert them

So I can’t make it send something when a player joins?

And where would I put the url and thumbnail parts? It might be that what is the cause.

No you shouldn’t

I edited my first post, read point 2

I’m giving it the we webhook before encoding it. Look in the script.

The first parameter must the the encoded data and the second one the Webhook url