what should be the header and data format for https://api.upstox.com/live/pricealert.
I am getting below error
{“message”:“'access_token” not a valid key=value pair (missing equal-sign) in Authorization header: 'Bearer access_token."}, In the error message it would print the actual access code.
url = “https://api.upstox.com/live/pricealert”
# Upstox API credentials
API_KEY = "api_key"
ACCESS_TOKEN = "api_key"
headers = {
"x-api-key": API_KEY,
"Authorization": "Bearer " + ACCESS_TOKEN,
"Content-Type": "application/json"
}
# Body of the request
data = {
"symbol": symbol,
"price": price,
"type": "Above"
}
# Make HTTP POST request to set the alert
response = requests.post(url, headers=headers, json=data)