Expose an endpoint for Roblox servers

As a Roblox developer, it’s currently too hard to communicate with Roblox servers from an external server.

Exposing a HTTP endpoint, eg https://game.roblox.com/{GameID}/{Function}/{JobID} would make this possible. The developer would have to first create an endpoint in studio by uploading an endpoint from the game explorer, similar to uploading a package. The player can then bind a function to run in that server whenever the endpoint is invoked. If the endpoint is invoked without a specific JobID then the endpoint package will run in every server

--TeleportPlayerToJob endpoint, allowing for easy cross-server match making managed by an external server
game:GetService("HttpService"):BindToEndpoint("TeleportPlayerToJob", function(Request)
    if (game.JobId == Request.JobId) then return true end    

    local TeleportPlayer = game.Players:GetPlayerByUserId(Request.PlayerId)

    game:GetService("TeleportService"):TeleportToPlaceInstance(game.PlaceId, Request.JobId, TeleportPlayer)
end)

Then fire a request from an external server

RequestData = {
    Url: "https://game.roblox.com/185655149/TeleportPlayerToJob/719fb424-d60d-40a2",
    
    Body: {
        PlayerId: "1",
        JobId: "e9feed6b-235e-4040"
    },

    Headers = {
         ["Authorization"] = "hmac sha256 digest of {url.body}"
    }
}

Capture

12 Likes

This seemingly contains no description of use cases, only a proposed solution. You’ll want to describe your problem rather than a proposed solution.

See the feature request guidelines: How to post a Feature Request

2 Likes

I could actually really use this. My game utilizes a discord bot which interacts with the Rover API to determine which roblox id’s are associated with which discord Id’s. With that information, I can reward players who boost the discord server with in-game perks and rewards. For a short time I had this but I had to write to a Google Spreadsheet with the discord bot and then periodically read that spreadsheet from the game. It ended up being too costly and I gave up on adding that functionality to the game, but an endpoint would be very nice and would let me do this in a more efficient way. I could probably think of some other use cases as well but an endpoint would be nice to support this kind of thing.