Navigation

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

    Blank Response From Curl

    Python SDK
    2
    2
    34
    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.
    • C
      Chaitanya last edited by

      Hi
      After getting token from https://smartapi.angelbroking.com/publisher-login?api_key=xxx

      when I use this token in other API
      I amgetting blank response.

      auth_token = request.args.get('auth_token', default = 1, type = str)
      conn = http.client.HTTPSConnection("apiconnect.angelbroking.com")
      payload = ""
      hostname = socket.gethostname() 
      clientLocalIP=socket.gethostbyname(hostname)
      clientPublicIP=get('https://api.ipify.org').text
      headers = {
        'Authorization': 'Bearer '+auth_token,
        'Content-Type': 'application/json',
        'Accept': 'application/json',
        'X-UserType': 'USER',
        'X-SourceID': 'WEB',
        'X-ClientLocalIP': clientLocalIP,
        'X-ClientPublicIP': clientPublicIP,
        'X-PrivateKey': 'XRAIVVdO'
      }	
      conn.request("POST","/rest/secure/angelbroking/user/v1/getProfile",payload,headers)
      res = conn.getresponse()
      data = res.read()
      print(data)
      return data.decode("utf-8")
      

      Response --> ''

      What is the error here?

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

        HI @Ved12345 , Thank you for remote access. The issue is now resolved.

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