Navigation

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

    Get Holdings response error

    Test
    5
    12
    118
    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.
    • T
      tdeshmukh last edited by

      Hi @admin ,

      I am not able to get response of get holding api. I am using python SDK. My account id is 'V44628'

      --- Sample code ---
      from smartapi.smartConnect import SmartConnect #

      obj=SmartConnect(api_key='xxxxxxx', debug=True)
      data = obj.generateSession("xxxxxxx","xxxxxxx")
      refreshToken = data['data']['refreshToken']

      Get Holdings

      hold = obj.holding()
      print ("\nHoldings --> ", hold)

      ---- Response ----
      DEBUG:smartapi.smartConnect:Request: GET https://apiconnect.angelbroking.com/rest/secure/angelbroking/portfolio/v1/getHolding {} {'Content-type': 'application/json', 'X-ClientLocalIP': '127.0.0.1', 'X-ClientPublicIP': 'xx.xx.xx.xx', 'X-MACAddress': 'xx:xx:xx:xx:xx:xx', 'Accept': 'application/json', 'X-PrivateKey': 'xxxxxxx', 'X-UserType': 'USER', 'X-SourceID': 'WEB', 'Authorization': 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJ1c2VybmFtZSI6IlY0NDYyOCIsInJvbGVzIjowLCJ1c2VydHlwZSI6IlVTRVIiLCJpYXQiOjE2MTY0OTYwMzYsImV4cCI6MTcwMjg5NjAzNn0.mMn0QTBLDFJ0Lj2zULOPKUSeWWdZIkTFzGUCTXvwHykwsuazRPc4Iatrf20TXoDwNLWmH6XERVdMB95pvTBUdw'}
      DEBUG:urllib3.connectionpool:https://apiconnect.angelbroking.com:443 "GET /rest/secure/angelbroking/portfolio/v1/getHolding?%7B%7D HTTP/1.1" 200 112
      DEBUG:smartapi.smartConnect:Response: 200 b'{"status":false,"message":"Get T1 Hodling Response : Bad Input...Error Code:0","errorcode":"AB1007","data":null}'

      Holdings --> {'status': False, 'message': 'Get T1 Hodling Response : Bad Input...Error Code:0', 'errorcode': 'AB1007', 'data': None}

      A J 2 Replies Last reply Reply Quote 0
      • A
        admin @tdeshmukh last edited by

        Hi @tdeshmukh please try below piece of code

        from smartapi import SmartConnect

        obj=SmartConnect(api_key="")

        data = obj.generateSession("","")
        refreshToken= data['data']['refreshToken']

        #fetch the feedtoken

        feedToken=obj.getfeedToken()

        print ("this is my feed token" ,feedToken )

        #fetch User Profile
        userProfile= obj.getProfile(refreshToken)
        print (userProfile)

        hold = obj.holding()
        print (hold)

        1 Reply Last reply Reply Quote 0
        • J
          jiwan1986 @tdeshmukh last edited by jiwan1986

          @tdeshmukh I tried your code and it's working fine from my side. Double check your credentials.

          A 1 Reply Last reply Reply Quote 0
          • A
            admin @jiwan1986 last edited by

            HI @rjbanna said in Get Holdings response error:

            @tdeshmukh I tried your code and it's working fine from my side. Double check your credentials.
            I really appreciate your support.

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

              Hi @admin,
              Thanks for the quick response.

              I am able to get response from other apis.
              #fetch User Profile
              userProfile= obj.getProfile(refreshToken)

              Get RMS Limit

              rmslimit = obj.rmsLimit()

              But the holdings api seems to give error.
              I got my account migrated couple of days back. could there be some issue with my account / migration.

              S A 3 Replies Last reply Reply Quote 0
              • S
                Surya 1 @tdeshmukh last edited by

                @tdeshmukh

                @tdeshmukh said in Get Holdings response error:

                'errorcode': 'AB1007'

                this is an AMX error. which version of Python SDK are you using ?

                1 Reply Last reply Reply Quote 0
                • A
                  admin @tdeshmukh last edited by

                  Hi @tdeshmukh your account has been migrated.We will connect you to resolve your issue.

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

                    @admin said in Get Holdings response error:

                    Hi @tdeshmukh your account has been migrated.We will connect you to resolve your issue.

                    As per the discussion on the call we will connect you as per your time convenience and resolve your issue.

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

                      This post is deleted!
                      1 Reply Last reply Reply Quote 0
                      • A
                        admin @tdeshmukh last edited by

                        Hi @tdeshmukh can you please update regarding your issue.

                        P 1 Reply Last reply Reply Quote 0
                        • P
                          psshri @admin last edited by

                          @admin I'm also getting this error, what can I do, I have filled the migration form but i am not associated with any sub broker

                          A 1 Reply Last reply Reply Quote 0
                          • A
                            admin @psshri last edited by

                            Hi @psshri can you please post your issue in correct thread.

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