Python, Auto Rank Bot, Not Working "The roleset is invalid or does not exist."

Hello,

I tried making an rank bot which is supposed to change the specific users roleset to an other one. I keep getting that one error: “{‘errors’: [{‘code’: 2, ‘message’: ‘The roleset is invaid or does not exist.’, ‘userFacingMessage’: ‘The roleset is invalid or does not exist.’}]}”

Appearentely it is invalid, when I test it on the doc site the roleset ID works fine.

The Script:

`

t = requests.request("PATCH", "https://groups.roblox.com/v1/groups/7166374/users/983009155" ,data={"body": json.dumps({"roleId": 45285892})}, cookies={".ROBLOSECURITY": SECURITY_TOKEN}, headers={"X-CSRF-TOKEN": x_csrf_token,'Content-Type': 'application/json'}).json()

print(t) 

Answers are appreciated.

I think the roleId should be the id of the role you’d like to change to??

(I’m not sure, I only use noblox.js lol)

It is the role id of the “other” role the user is supposed to be ranked to.

The roleId should be the value thats inbetween 0 and 255.

(edit so i dont have to reply:)
oh ok. i get those confused sometimes :v

That’s the rank Id not the role id.

The role ID is like an Asset ID Basically.

As said it errors that it dosen’t exit, but when I test it on the docs site on the “try out” thing it works fine and dosen’t outputs that error, I think it’s something with the data dictionary but I cannot figure out what. I tried already many combinations.