How do I get a game's social links via ROBLOX's API

Hello, (again)

Lately, I have been having difficulties trying to get a game’s social link through ROBLOX’s API

Firstly, I tried using :arrow_down: but the problem was that this API requires an Authenticated User to work therefore I got this error: HTTP 401 (Unauthorized)

pcall(http.GetAsync, http, "https://games.rprxy.xyz/v1/games/"..universeId.."/social-links/list")

After that, I tried putting a .roblosecurity cookie in a header, and yet again, I ran into some problems such as: Header "cookie" has unallowed character "|" and Header "cookie" has unallowed character "%" after I tried using HttpService:UrlEncode(). This is probably because I incorrectly formatted the cookie.

Script
local isSuccessful5, response5 = pcall(http.RequestAsync, http, {
    Url = "https://games.rprxy.xyz/v1/games/"..universeId.."/social-links/list",  
HTTP requests
    Method = "GET",
    Headers = {
      ["Content-Type"] = "application/json",
      ["cookie"] = [my actual .roblosecurity cookie]
    },
                    
})

And now, I have no clue what to do next and any help would be useful. Thanks :smiley:

3 Likes

I would be happy to give the test .roblosecurity cookie if you want to see how I formatted the cookie.

1 Like

You can’t pass a .ROBLOSECURITY through the header, it seems, unfortunately. You’d have to use your own server as a proxy and store headers on that instead of passing it through HttpService, or something similar.

5 Likes

Could you elaborate more on that. Like how do I make a proxy server?

as rogchamp said you cant pass your .ROBLOXSECURITY Code, and also what are you trying to do with this script can you explain it to me more briefly

You would just make a request to a website you can host code on. I’ve used AWS Lambda in the past, but something like Heroku or Glitch could probably work for this. When you make the request, have the server make a request to the actual site you want (the games.roblox.com endpoint) and have it use the headers you want from your server, not sending them through HttpService.

4 Likes

The API requires an 13+ Authenticated User to work since it is about Social link which is not available for account under 13.
The problem is that the server doesn’t have A User therefore It is Unauthorized.

I hope that clears things up.

Thank you for the help, I will definitely try that.

Just one more thing, how would I send back the data to my Roblox server?

I am assuming I will have to do a HttpService:GetAsync() from Roblox to my Glitch Server but, I need confirmation.

EDIT: Clarification

Assuming you’re using Express.js, you can simply attach JSON data to the body of the response (since GET requests allow you to do so).

ie.

response.json("Example value, can be anything which could be JSON encoded")
    .status(200) // 200 tells us that the request went through all fine
    .end(); // Closes the response and finishes the HTTP request
1 Like

I have tried doing that but like I said I ran into some problems:

You can also view my script.

I am using Node.js but, thanks for the help.

Express is a Node.JS module, it’s a piece of middleware designed to make web servers easier to develop. You can read about it here

2 Likes

Okay, I haven’t worked with JavaScript before so I wouldn’t know, but again, thanks for the information.
I think I will go over some tutorials online to make this proxy server.