I am new to using APIs for trading. I just started my journey as API developer. So I am using my laptop as client server where I will be creating my scripts.
i have created app in Sandbox environment and in third step where we would get token in response I am facing issue that received error_code":“UDAPI100500” and message”:"Profile not found for input identifier.
here is sample code i have used to get token,
import requests, json, time, webbrowser
from http.server import BaseHTTPRequestHandler, HTTPServer
API_KEY = “XXXXXX” “passed my API Key
API_SECRET = “XXXXXXX” “Passed API secret key
REDIRECT_URI = “http://localhost:8080/”
UCC = “3MAFLJ”
url = “https://api-sandbox.upstox.com/v2/login/authorization/token”
headers = {
‘accept’: ‘application/json’,
‘Content-Type’: ‘application/x-www-form-urlencoded’,
}
params = {
‘code’: ‘=JYGBAN&state=HLJREAD’,
‘client_id’: API_KEY,
‘client_secret’: API_SECRET,
‘redirect_uri’: REDIRECT_URI,
‘grant_type’: ‘authorization_code’,
}
response = requests.post(url, headers=headers, params=params)
print(“Response:”, response.text) .
appreciate if someone help what might be the issue?