Presence API unwanted behaviour

Hello Developers, I’m facing problems with the Presence API which I haven’t found (recent) posts or solutions about. So:

  1. Is the Presence v1 endpoint still usable or is there another option to get the current game that a player, given its id, is playing?

  2. While trying to use the presence/users endpoint to get the infomation in the previous question, it retrieved me only partial information: “lastOnline”, “userPresenceType” and “lastLocation” when the player wasn’t in a game; and didn’t retrieved any information about the game, such as its id. I tried it on:

  • Studio: Using a proxy. The result was the mentioned above.
  • Python script: The result was the mentioned above.
  • Swagger executor: The one which is hosted on the endpoint link. It allows you to input a payload (the user ids), and execute the POST request. It gave me the result that I wanted, all the information fields about the about the player presence.
  1. Lastly, I don’t know why my POST requests didn’t returned me the same as the POST request done by the Swagger executor. So, I wan’t to know what is being done different between my request and the executor request.

I’m not well-versed in web requests, but one thing to bear in mind are the privacy settings of the target users.

I have my privacy settings set such that only my friends can follow me to games. If I perform a request using the Swagger executor from a browser that I or any of my friends are currently logged in to, I get all the information the endpoint returns; however, if I make the same request while logged out or logged into an account that I am not friends with, all of the game-related data fields are nulled out.

1 Like

Now that you mentioned it, I tested 2 situations using the swagger executor:

  1. When executed in a browser that I’m logged on my Roblox account, it returns all the information that I’ve wanted only when the target had the privacity settings set to Everyone, despite the target being my friend or not.

image

  1. When executed in a browser that I’m not logged on my Roblox account, it returns all the partial information despite any settings that the target player has activated.

image

So my conclusion is, there’s something related to my account being sent through the POST request. So I want to know what is it and if there’s a way to replicate it on outside the swagger executor, such as the Roblox Studio.

The Swagger executor does appear to access your ROBLOX security cookie, so that’s probably the difference. While the cookie is not required to make the request, perhaps it is required to receive any information about the current game.

Do you know a way to send it through the request?

As far as I am aware, Roblox doesn’t allow direct requests to its API from its own servers. You can use things like ProxyService to get around that, though it’ll probably take some time and diligence to fully set up. You’ll have to include in that proxy your authentication information so make sure it’s a source you can trust.

If you want to make requests to the Roblox API outside of studio, python has been always fine for me and only requires a header that has your cookie to authenticate yourself.

Here’s a topic showing what requests look like in python:

Hopefully this is helpful for you!

2 Likes

It’s working now! Thank you @MysteriousVagabond and @DyIan_II, you both contributed in solving this one.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.