401 Error "Authorization has been denied for this request"

So I wanted to write some Python code that would update the status of a group, but when I ran it, it returned the following error: “Authorization has been denied for this request.” Could someone please assist me with this because I am not very good with Python? Here is my code:

import requests

payload = {"message": "string"}
payloaddata = {'username': "XXX", 'password': "XXX"}

r = requests.patch('https://groups.roblox.com/v1/groups/XXX/status', json=payload, data=payloaddata)
print(r.text)
print(r)
3 Likes

I don’t know anything in Python but I assume you would have to use your cookie instead of an username and password

Where inside of the payload would I have to put my cookie

You would have to delete username and password and replace it by cookie ig
Also you should probably use ro.py and do this:

from roblox import Client
client = Client("your token")
group = client.get_group(0000000)
r = group.shout("string")
print(r)

This, and the other quirks of the Roblox web API, are explained here:

As mentioned earlier by @dinat13 you may want to use a web API wrapper (like ro.py) which simplifies things considerably.

3 Likes