Hello,
I am rather new to scripting and I am trying to get a user’s last online status. I am trying to use the endpoint https://presence.roblox.com/v1/presence/last-online, but I do not know how to pass in the user id. Does anyone have a code example that works for this?
1 Like
You would send a post request to the endpoint with a JSON body that looks like this:
{
"userIds": [
0
]
}
You would populate the userIds array with the ids of users who you wish to look up.
How do I add the body to the request?
If you are going to be using this within Roblox, you will need a proxy since Roblox does not permit requests to its own APIs in game. Nevertheless, you can take a look at either RequestAsync or PostAsync to learn how to make a post request on Roblox.
I know I will need a proxy, but I am still confused on how to pass parameters (user ids) into the api url. I read through that link and I don’t see anything that would be helpful in this case. I don’t think I need to make a post request.