I’m trying to change someone’s rank on my group with the Groups Api. os.environ[".ROBLOSECURITY"]
is my account key I got from the cookies page. It worked in another project with the catalog, and economy APIs but it doesn’t work in mine. I decided to use the exact same key to get my robux balance and it worked. Why isn’t it working with the Groups API?
python code:
import requests, os
userId = 2747902661
response = requests.patch(f"https://groups.roblox.com/v1/groups/9697297/users/{userId}", cookies={".ROBLOSECURITY": os.environ[".ROBLOSECURITY"]}, json={"roleId": 73986715})
print(response.status_code, response.text)
response = requests.get(f"https://api.roblox.com/currency/balance", cookies={".ROBLOSECURITY": os.environ[".ROBLOSECURITY"]})
print(response.status_code, response.text)
This is the Output:
403 {"errors":[{"code":0,"message":"Token Validation Failed"}]}
200 {"robux":508}