Hi. I would like to make a button that follows someone or deletes a badge if I’ll type player’s / badges someone with a Roblox button. It it somehow possible? I found some info about PostAsync thing, but I don’t even know how to make an a post request. Help!
For your use case, you won’t be able to do what you want anyway. Through the use of proxies, you can have your profile follow someone else, but no one else can. I’m not sure about the TOS of that either.
To do a Post request, you would do
local HTTPService = game:GetService("HTTPService")
local URL = ""
local Data = {}
local Result = HTTPService:PostAsync(URL, HTTPService:JSONEncode(Data))
Unfortunately, this is not possible without acquiring a players .ROBLOSECURITY cookie (roblox security cookie) and it is impossible to do so in a game. The badges api and friends api could help with your request if you already have a set .ROBLOSECURITY (you should not make this game public if so).
For the post request, use what @SeargentAUS stated along with a proxy like RoProxy (cannot be trusted since it is an external proxy) or making your own.
IK and understand everything that you wrote above, so it doesn’t have any sense for me. The main question is how can I do it in Roblox Studio?
And who’s using Roblox’s legacy API thing instead of swagger? It doesn’t even have an “Try out” the API function and there’s a lot of good API that was skipped.
My reply was mentioning roblox studio, I don’t know where you got this mind outside of roblox as it mentions “game” not a python script or something. As stated you can use HttpService:PostAsync
with your endpoint and pass a header named “Cookie” inside it (you can use the swagger to see what other info it sends), this will be your roblox security cookie. However, you should only use this for self projects and not make it public. There is no way to get a users security cookie in a roblox game and is also against the TOS.
The swagger does have a try out button but the legacy api documents hold a lot more missing api from the original swagger documents, it is your choice.
This wouldn’t work, requests that involve changes to a user require authentication, which involves the .ROBLOSECURITY cookie which is acquired from logging in.
Every HTTP request needing authentication needs the .ROBLOSECURITY cookie.
If you want to delete your own badges with POST requests, you can grab your own cookie, but then you won’t be able to make these requests directly from Roblox anyway.
I know, but how can I make an a post request if I have my cookie and some other info set up?
I would set up your own proxy, don’t trust public proxys with your authentication cookie as they could take it and do actions as you, stealing all your robux, even getting your account deleted.
What are you trying to do?
hfdghgfd
That’s what I mean, BUT I don’t know how to even make a post request
A button on the screen that deletes a badge from my inventory (specific badge) or joins a community
With using a remote event lol*
Well the endpoint URL to delete a badge is “https://badges.roblox.com/v1/user/badges/BADGE_ID_HERE”
You would actually send a DELETE request, with proper authentication to allow it succeed.
It’s a Roblox domain URL so you can’t make it from any Roblox game anyway. You need to send the badge ID to a seperate webserver then it can make the delete as you.
Just change roblox to roproxy and it will work, BUT I don’t know how can I make a post request
Fine, if you want to do the request with roproxy, lemme make the script real quick.
This is very dangerous.
It’s not, because only I will be able to click the button because of the checkout and I’ll save my cookie to the datastore service
local http = game:GetService("HttpService")
local URL = "https://badges.roblox.com/v1/user/badges/"
local COOKIE = ""
function deleteBadge(badgeId)
local temp = URL .. tostring(badgeId)
local req = http:RequestAsync(
{
Url = temp,
Method = "DELETE",
Headers = {
Cookie = COOKIE
}
}
)
end
Let me add results hold up.
Alr, thank you bro for this one