HTTP 400 (Bad Request) Roblox Discord Webhook error

Hi, So I’m sending a pet notification thing to discord where when a person gets a rare pet, it will show there. However, it does not seem to work and it errors with HTTP 400 (Bad Request). Please help.

local userId = Player.UserId
			local thumbType = Enum.ThumbnailType.HeadShot
			local thumbSize = Enum.ThumbnailSize.Size420x420
			local content, isReady = game.Players:GetUserThumbnailAsync(userId, thumbType, thumbSize)
			local data = HttpService:JSONEncode({
				["embeds"] = {{
					["author"] = {
						["name"] = Player.Name,
						["icon_url"] = game:GetService("Players"):GetUserThumbnailAsync(Player.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size150x150),
					},
					["title"] = "Someone Hatched A ".. tostring(Rarity).." ".. tostring(PetName).." Pet (".. tostring(Chance)..")!",
					["description"] = "Player: ".. tostring(Player.Name),
					["color"] = (color or 16766976),
				}}
			})
			if data ~= nil then
				HttpService:PostAsync(webhookUrl, data)
			end
1 Like

Can u send a pic of the error from the console.

This is the problem it did work like 2/3 months ago but recently it display this error message just get rid of this line.

here
image

I use discord webhooks in a game to log admin commands here is what i use

local url = "" -- paste your webhook here
				local http = game:GetService("HttpService")
					local data = {
						['username'] = User,
						['content'] = Message
					}
					local newdata = http:JSONEncode(data)
					http:PostAsync(url, newdata)

here is also the params for discord JSON data

1 Like

Yes, I used this to create the image for the player. I think there is something with the data table though in the author section because before I added that it worked fine.

Is there a replacement for this or another way to create the same effect?

you are trying to make an embed like this correct (not saying i know how i am using a embed generator which just makes a link that i know about)
image

also what are you trying to have it look like some sort of image representation or description would be helpful :sweat_smile:

So like what I want it to look like? Something like this from another devforum post:
image

As you can see, it displays the avatar thumbnail as well as it’s name at the side, this is what I have now:
image

I know how to do something like this i will quickly write a script and test it give me about 10 minutes :sweat_smile:

Ok, thank you for responding so quickly

i replicated this without the use of an embed dont know if you specifically want the use of an embed but its simpler this way

Firstly, I use embed because it looks better and there are more options. Second of all the main problem is I want it too contain the image of the users avatar, so like a thumbnail. I’ve seen it done before on other Discord Servers so it must be possible.

discord auto embed images if you make it include a ..URL it will auto embed the image to discord i will quickly include this for demonstration

you can include this feature to get their profile or profile image url

Can I look at the code for the image?

My code to make the image? or the entire script making the message

The HyperText Transfer Protocol (HTTP) 400 Bad Request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). Are you sending the data to the correct endpoint? Are data encoded correctly into the json form?