You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I want to change the price of a gamepass using the roblox api in python
Here is my current code:
import requests
cookie = "_|WARNING:-DO-NOT-SHARE-THIS.--Sharing-this-will-allow-someone-to-log-in-as-you-and-to-steal-your-ROBUX-and-items.|_"
auth_response = requests.post("https://auth.roblox.com/v1/logout", headers = {"cookie": f".ROBLOSECURITY={cookie}"})
if auth_response.status_code == 403:
if "x-csrf-token" in auth_response.headers:
token = auth_response.headers["x-csrf-token"]
headers = {
"cookie": f".ROBLOSECURITY={cookie}",
"x-csrf-token": token
}
data = {
"isForSale": "true",
"price": "140"
}
message_response = requests.post("https://apis.roblox.com/game-passes/v1/game-passes/778571061/details", headers = headers, json=data)
print(message_response.json())
I keep getting this error:
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\Users\ADMIN\Downloads\test\hello.py", line 18, in <module>
print(message_response.json())
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ADMIN\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Im not sure why im getting this as all other apis work fine for me and i dont have 2 step enabled