Navigation

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

    How do I reuse the refreshtoken without having to generate it throughout the day whenever I want to use the API?

    Python SDK
    3
    6
    70
    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.
    • S
      s4ntosh last edited by

      How do I reuse the refreshtoken without having to generate it throughout the day whenever I want to use the API?
      Currently I am generating token every time I have to use the API.

      S 1 Reply Last reply Reply Quote 0
      • S
        Surya 1 @s4ntosh last edited by

        @s4ntosh

        You can use client.setAccessToken(access_token) attribute

        S 1 Reply Last reply Reply Quote 0
        • S
          s4ntosh @Surya 1 last edited by

          @rajanprabu Can you please provide a code snippet for python? I tried but I am still getting the following response:

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

          S 1 Reply Last reply Reply Quote 0
          • S
            Surya 1 @s4ntosh last edited by

            @s4ntosh

            for ordering

            obj = SmartConnect(api_key=api_key)
            obj.setAccessToken(access_token)
             resp = obj.getProfile(refreshToken)
            

            for web sockets

            ss = WebSocket(feed_token, client_code)
            
            A 1 Reply Last reply Reply Quote 0
            • A
              admin @Surya 1 last edited by

              Hi @s4ntosh please go through the doc or examples in python sdk:
              https://github.com/angelbroking-github/smartapi-python
              https://smartapi.angelbroking.com/docs/Orders

              T 1 Reply Last reply Reply Quote 0
              • T
                thiyagaraaj @admin last edited by

                @admin this link is not working: https://github.com/angelbroking-github/smartapi-python . I really dont know why your links are not working. blogs are really not helping with such broken link,

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