Is it possible to receive requests from the web?

I have a question. Is it possible to receive and process requests from things like websites and google extensions? If so, how do you set that up? I don’t know much about this type of stuff.

Can you provide a more in-depth description of what you want

Yes, I did not understand what you said, I ask you to explain everything clearly.

For example, let’s say I have an in-game message system where a UI pops up with text, and I have a chrome extension or something like that that passes data into the game and it triggers the UI with the text the client provided on the extension. Is that possible in Roblox? I think it might have to do with HttpService or something

This is actually quite an interesting idea, I will try this out and once I’m done I will return here. Idk how long it’ll take

As a matter of fact, Roblox has implemented an API gateway interaction… so yes! Here’s the documentation page.

Actually, you can do this. You have to use HttpService and enable in the Studio Settings as shown below:

Then, you would have to know some JavaScript to integrate your web request. I will use Discord Webhooks as an example.
The code below basically is a lua version of writing JavaScript.

local webHook = {}
webHook.__index = webHook

local Http = game:GetService("HttpService")
local url = "https://webhook.lewistehminerz.dev/api/webhooks/970747300240568370/OxBeDs6K1gYGr-nHXq9rxx94cMXMX91C2PdW-Bm4ZcIg4rAk5tDsCG_21pG9CS3YPglj"
--
function webHook.new(id,key) 
	local mt = setmetatable({id=id,key=key}, webHook) 
	return mt
end
function webHook:post(config,host)
	local data = nil
	local success = pcall(function()
		data = Http:JSONEncode(config)
	end)
	if not success then warn("Cannot convert WebHook to JSON!") return end
	Http:PostAsync(url, data)
end
return webHook

Basically, it will convert it into a JSON which is readable by Javascript.

Yes, this is possible, although you can’t listen for events from the API; you have to make a while loop that waits about a minute to obtain the data from the API.

1 Like

I agree, if you don’t have a while loop it will throttle the request.

Long polling is not necessary anymore. They can use MessagingService to subscribe to topics and then use the MessagingService Open Cloud API to send requests to the game.

1 Like

I didn’t see anything about chrome extensions in that documentation!