upstox/upstox-python

"errorCode":"UDAPI100060","message":"Resource not Found

Closed this issue · 2 comments

autologin.py

      import aconfig as l
      import urllib.parse 
      import pandas as pd 
      import requests
      from selenium import webdriver 
      import time
      import os
      from pyotp import TOTP
      
      def autologin():
          print('hello')
          browser = webdriver.Chrome()
          redirecturl = urllib.parse.quote(l.rurl,safe="")
          print (redirecturl)
          browser.get('https://api-v2.upstox.com/Login/authorization/dialog?client_id='+l.apiKey + '&redirect_uri=' + redirecturl)
          browser.implicitly_wait(99999999999)
          mobilenumber = browser.find_element("xpath", '/html/body/main/div/div[3]/div/div/div[2]/div[1]/div/div/div[2]/form/div/div/div/div/input').click()
          mobilenumber.send_keys(l.mobilenumber)
          browser.implicitly_wait(5)
          bclick = browser.find_element("xpath", '/html/body/main/div/div[3]/div/div/div[2]/div[1]/div/div/div[2]/form/div/button').click()
          browser.implicitly_wait(5)
          totp = TOTP (l.totp)
          token = totp.now()
          token=int(token)
          print(token)
          otpnumber = browser.find_element_by_id("otpNum")
          otpnumber.send_keys(token)
          browser.implicitly_wait(5)
          bclick= browser.find_element("xpath", '/html/body/main/div/div[3]/div/div/div[2]/div[1]/div/div/div[2]/form/div[2]/button').click()
          browser.implicitly_wait(5)
          browser.implicitly_wait(5)
          otpnumber = browser.find_element_by_id("pinCode")
      
      
          otpnumber.send_keys(l.key)
          browser.implicitly_wait(5)
          bclick= browser.find_element ("xpath", '/html/body/main/div/div[3]/div/div[1]/div[2]/div[1]/div/div/div[2]/form/button').click() 
          time.sleep(5)
          temp_token=browser.current_url.split('code=')[1][:6]
          # Save in Database or text File
          print('temp_token', temp_token)
      
          
      autologin()

aconfig.py

    apiKey = '*****************'
    secretKey = '**************'
    rurl = 'https://127.0.0.1' 
    mobilenumber='**************'
    totp='********************'
    token_df=None 
    key=********

it comes an error like this
{"status":"error","errors":[{"errorCode":"UDAPI100060","message":"Resource not Found.","propertyPath":null,"invalidValue":null,"error_code":"UDAPI100060","property_path":null,"invalid_value":null}]}

image

I want to get my access token how do I get ?

give a sample code for this ?

@pradeepbharath do not share such sensitive info publically.

@Rahulzz Request you to edit/delete previous comment to be safe.

We do not endorse the automation of Two-Factor Authentication (2FA) or obtaining access tokens in accordance with regulatory guidelines. I suggest implementing the OAuth flow as outlined in the official documentation available at this link: https://upstox.com/developer/api-documentation#tag/Authentication