API Error: Authorization has been denied for this request python

Hello I’m trying to create a simple script in python that allows the bot to accept a join request through the code. However im getting the authorization has been denied for this request error. Im also not sure if I wrote my code correctly. Here is the API doc i used:

    group_id = 6540790
   roblox_id = 1806025993
   cookies = {'.ROBLOSECURITY': ROBLOX_COOKIE}
   url = f'https://groups.roblox.com/v1/groups/{group_id}/join-requests/users/{roblox_id}'
   r = requests.post(url,data=None,cookies=cookies)
   print(r.text)

Thanks in advance!

Try

url = f('https://groups.roblox.com/v1/groups/{}/join-requests/users/{}'.format(group_id, roblox_id))

Thanks for your reply. Unfortunately the same response :confused:

After some research I found out that you’ll also have to include the “X-CSRF-TOKEN”. Does anyone know how I could get this token?

The csrf token should be in the headers of the first post request.

Also, I’m pretty sure the response would be “Token Validation Failed” if the csrf was needed. Maybe you’re just not setting the cookies correctly?

1 Like

Thank you for the response. I finally got it to work. I forgot to include the CSRF-token
in the headers.