HttpService: HTTP 403 (Forbidden) Error

You can’t post to discord, without nothing. You either create a plain text using an embed,


local httpService = game:GetService("HttpService")

	local URL = "URL" -- I put my URL here but as i said before i'm gonna hide it to prevent problems
	local Data = httpService:GetAsync(URL)
	local Announcement = game:GetService("ReplicatedStorage").ANNOUNCEMENT
	local RemoteEvent = game.ReplicatedStorage:WaitForChild("RemoteEvent")

while wait() do
	
	RemoteEvent.OnServerEvent:Connect(function()
		local data = {
			["embed"] = {{
				["Title"] = "test",
				["Description"] = Announcement.Value
			}}
		}
		local EncodedData = httpService:JSONEcode(data)
		httpService:PostAsync(url, EncodedData)
end)
2 Likes

Hi! thank you for your answer! i think i didn’t explain what i want to know.
This is the kind of announcement i’m talking about:

But my problem is the “Http forbidden” error, i want to know how can i fix it.

Thank you anyway!

1 Like

Why are you using HTTPSERVICES, for an announcement…?

URL > Webhook URL,
If you want a specific value set to that you do that via a local script making a textbox & a textbutton, and a script inside the frame with them inside.


script.Parent.TextButton.MouseButton1Click:Connect(function()
      game.ReplicatedStorage.ANNOUNCEMENT.Value = script.Parent.TextBox.Text
end)

Elsewise, if you are creating an automatic, announcement system you can do this.

local MessageTable = {"hi","lol"}

while wait(5) do
script.Parent.ANNOUNCEMENT.Text = math.random(MessageTable, #1)
end
2 Likes

What i’m trying to make is a GLOBAL announcement, so i can send a message in every server without update the game (and without shutdown it), i’m also using the http service for other things, like change the time of a live countdown, etc…

You can use MessagingService instead.
Btw where are you sending the request? To discord?

1 Like

If you are looking for something like me, document you.
Also utilize the developer hub for other documentations of that type. ^^

No i’m not sending it to Discord, it’s a global announcement inside my roblox game.

1 Like

Nvm I thought it’s a POST request

1 Like

Thank you so much, but i’m looking for other things, my MAIN problem is about this error i’ve said before, nothing else, just this error, i want to know how to fix it.
image

1 Like

The http 403 response mean that the access to the website is forbidden. Are you sure you don’t need to set any headers like authorization?

Let me explain, so i’ve put a BoolValue in Replicated Storage, i made a LocalScript where the TextLabel text contains the BoolValue text, i’m currently using a page called “Pastebin” where i can edit my code and put the new announcement there, so i’m using the HttpService to get the data of my code in Pastebin. So that announcement should be posted in every single server with no problem, but recently i had this error that doesn’t let me do anything with the httpservice.
image

Where are the URL’s being sent? You don’t have to hand out the actual url itself, but is it to Roblox? Discord? This will most likely tell us the issue!

(Edit: Apologies, missed the url)

what do you mean by “headers”?

Did you set the paste to be private or set it’s password?

Hello, i’m currently using this page to change the annoucement text,

But i had this problem and now i apparently can’t do anything.
image

OK so i’ve got the problem here, i don’t know what is happening, i just wrote the url here and got me the same error.
image

It would be a LOT easier using a table.
Thus being,

local TableMessages = {"hi","releasing soon","announcement?"}

But can that table change in real time? like in every single server without shutdown the server?

Or, an alternative. Firebase, another good way and it’s auto-updated.

Let’s give an example: imagine there’s a live event, and i need to announce something saying that the event will be delayed due to some problems, how do i send that announcement to every server active, without update/shutdown the game? i don’t want the announcement to be published only in the server i am.