HTTP Forbidden while using a webhook

Hello!
Currently I got a problem which I used HTTPSerivce to send information of a player speedrun to a discord server. The problem is that it keeps getting a Forbidden error

My solution was to enable http service, enabled third party teleport and make a game public but it still throwing an error “HTTP 403 Forbidden”.

Code:

	local webhookurl = webhookurl -- This can be found by going into your discord server settings then going to integrations then going to webhooks
		local data = {
			["embeds"] = {{

				["author"] = {
					["name"] = player.Name,
					["icon_url"] = "https://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&username="..player.Name
				},
				["description"] = "Mission Completed",
				["color"] = tonumber(0xFFFAFA),
			["fields"] = {
					{
						["name"] = "Time Used :",
						["value"] = game.Workspace.TimeUsed.Value,
						["inline"] = true
					},
					{
						["name"] = "User ID:",
						["value"] = player.UserId,
						["inline"] = true
					}
				}
			}},

		}
		local finaldata = HTTP:JSONEncode(data)
		HTTP:PostAsync(webhookurl, finaldata)

I review the code but theres nothing wrong, the error starts on the line

HTTP:PostAsync(webhookurl, finaldata)
Which was a process to send a data to discord webhook

Please help!

3 Likes

Discord has banned Roblox’s useragent from sending webhooks to their api due to abuse, you should stop using them to log info, if you really want to then use proxies

Alternatively use Guilded which is now owned by Roblox (but still a seperate independent company)

2 Likes

Discord stopped banning Roblox’s UserAgent sometime in 2019 after Roblox updated HTTPService.

Edit: Upon receiving further information, Discord has banned Roblox’s UserAgent again, go figure. Best solution is a proxy or using services for analytics (like Sentry) rather than reporting to a Discord webhook. :stuck_out_tongue:


To answer the post though:

Discord changed their domain from discordapp.com to discord.com and had announced that old API endpoints would eventually be deprecated. Consider changing discordapp.com to discord.com in your webhookurl.

You also might be sending data to the wrong endpoint or sending the wrong data. Consider reading Discords developer docs for webhooks.

P.S. I recommend editing your post to remove your webhook information and deleting that webhook and creating a new one as you don’t want your webhook keys to be public.

2 Likes

Didn’t Discord banned Roblox’s server again since November 2021?

2 Likes

I’d have to test for myself — if they have banned Roblox’s UserAgent again then OP will need to use a proxy to report to Discord webhooks.

Regardless, while it doesn’t suffice as a solution, using analytic services instead is always an option or just creating your own in-game analytics for this data rather than reporting to a Discord webhook.

2 Likes
1 Like

Thanks! I just red a document.

2 Likes

Also it did work out when i tried on the first time. But most of the time it failed
(so that might be a problem about sending a data)
check-here - Discord - Gyazo

1 Like

Also, it seems to work in studio but not in a roblox application :frowning:

2 Likes

Because Studio uses a different useragent (and your home network)

1 Like

I’ve gotten this error before, the simplest thing you can do is change the https://discordapp.com to https://webhook.lewistehminerz.dev. Changing the link really works out for me, and I think it could work out for you too!

3 Likes

or u can create ur own system using the discord webhook.

1 Like

Im sorry but it gonna be something like this?
https://webhook.lewistehminerz.dev/apilinkhere
?

2 Likes

It should be https://webhook.lewistehminerz.dev/api/webhooks/somecodebehindthis.

3 Likes

Thanks! it worked! thank you for your time! tysm!

2 Likes

Of course, glad to be able to help you! :smile:

1 Like

What do you mean with “somecodebehindthis”?

2 Likes