I want to make a POST request to https://presence.roblox.com/v1/presence/users but it keeps saying "There was an error while accessing presence.roblox.com: HTTP 400 (Bad Request). I’ve looked on the Forum if somebody else has it but I found no post about it. Here is the Script I’m using:
-- Services
local HTTP = game:GetService("HttpService")
local ReplicatedS = game:GetService("ReplicatedStorage")
-- Variables
local URL = "https://presence.roproxy.com/v1/presence/users"
local Remote = ReplicatedS:FindFirstChild("Player")
-- Functions
local function getPresenceData(plr : Player, userID : number)
local presenceData = {}
local data = HTTP:JSONEncode({
["userIds"] = userID
})
local succ, response = pcall(function()
return HTTP:PostAsync(URL, data)
end)
if succ then
print(response)
Remote:FireClient(plr, response)
else
warn("There was an error while accessing presence.roblox.com : " .. response)
end
end
Remote.OnServerEvent:Connect(getPresenceData)
It would be cool if somebody had a solution