#Need help getting username from token

1 messages · Page 1 of 1 (latest)

pulsar hatch
#

🤔

violet harbor
#

I have a cookie, how do I get the username from it?

#

/v1/users/authenticated ?

#

Error 405

#
def rbx_request(method, url, **kwargs):
    request = session.request(method, url, **kwargs)
    method = method.lower()
    if (method == "post") or (method == "put") or (method == "patch") or (method == "delete"):
        if "X-CSRF-TOKEN" in request.headers:
            session.headers["X-CSRF-TOKEN"] = request.headers["X-CSRF-TOKEN"]
            if request.status_code == 403:  # Request failed, send it again
                request = session.request(method, url, **kwargs)
    return request```
#

@pulsar hatch

#

oop I suppsoed to make get requ

#

Still errors

#
Pdata = session.request("GET", "https://users.roblox.com/v1/users/authenticated")
print(Pdata.id)
print(Pdata.name)
print(Pdata.username)```
#
File "C:\Users\user1\Desktop\Image\Assets\Scripts\api.py", line 60, in <module>
    print(Pdata.id)
          ^^^^^^^^```
#
'Response' object has no attribute 'id'```
#

All I get is 200

#

I FIXED IT

#

Now I get this {b'{"id":4266744785,"name":"ChaseRudlophtrader","displayName":"ChaseRudlophtrader"}'}

#

How do I get just the id from that

#

@pulsar hatch can u hel

maiden osprey
#

get the json object (will be converted into a dictionary) then get the id