this is only code i have with me . i am running below code on google colab. i am using in my own browser and getting code from there and then using it on script running on google colab
import requests
import pandas as pd
import urllib.parse
apikey = "***************************"
secrete_key = "***********"
redirect_url = "https://192.168.0.255:5000"
url =f"https://api.upstox.com/v2/login/authorization/dialog?response_type=code&client_id={apikey}&redirect_uri={redirect_url}"
print(url)
code = input("input code")
#accest token
code
rurl = urllib.parse.quote(redirect_url,safe = "")
url = "https://api.upstox.com/v2/login/authorization/token"
data ={"code": code,
"client_id" : apikey,
"client_secret": secrete_key,
"redirect_uri": redirect_url,
"grant_type": "authorization_code"}
headers = {"Content-Type" : "application/x-www-form-urlencoded",
"Accept":"application/json"}
response = requests.request("POST", url, headers=headers, data=data)
print(response.text)
I am getting following error
{"status":"error","errors":[{"errorCode":"UDAPI100058","message":"No segments for these users are active. Manual reactivation is recommended from Upstox app/web.","propertyPath":null,"invalidValue":null,"error_code":"UDAPI100058","property_path":null,"invalid_value":null}]}
please help me to solve issue