Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    invalid token error python

    Python SDK
    0
    7
    75
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      divy1520 last edited by

      {'success': False,
      'message': 'Invalid Token',
      'errorCode': 'AG8001',
      'data': ''}

      this error is showing what should i do...?

      1 Reply Last reply Reply Quote 0
      • W
        whemant last edited by

        Hello @admin , any updates on this issue. I am also getting this error from last couple of days. I have checked the symbol token I am using is correct.

        D 1 Reply Last reply Reply Quote 0
        • D
          divy1520 @whemant last edited by

          @whemant hey can you please tell me how i can check the symbol token...?

          W 3 Replies Last reply Reply Quote 0
          • W
            whemant @divy1520 last edited by whemant

            @divy1520 you can check symbol tokens in https://margincalculator.angelbroking.com/OpenAPI_File/files/OpenAPIScripMaster.json

            1 Reply Last reply Reply Quote 0
            • W
              whemant @divy1520 last edited by

              @divy1520 Sorry, I think this error is not related to symbol token. I am not aware of this error. @admin please could you help us with error asap. Thanks. My user id is "H118070".

              1 Reply Last reply Reply Quote 0
              • W
                whemant @divy1520 last edited by

                @divy1520 I managed to fix this error. My code was not able to generate the feedToken. Check if your code is generating the feedtoken correctly.

                obj = SmartConnect(api_key="API_KEY")
                data = obj.generateSession("CLIENT_ID","PASSWORD")
                feedToken = obj.getfeedToken()

                This is how you generate a feedtoken.

                do a print(feedToken), if it is None, check values in the data - print(data).

                For me, it was showing a message that my password was expired. I changed my password in trading portal and the code worked fine. I got to know that the password has a validity of one year. Trading portal does not show this error, but API does.

                D 1 Reply Last reply Reply Quote 0
                • D
                  divy1520 @whemant last edited by

                  @whemant thank youuu so so much, i have same issue, thanks for helping.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post