Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs
    1. Home
    2. DIYD57519
    D
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    DIYD57519

    @DIYD57519

    0
    Reputation
    5
    Posts
    1
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    DIYD57519 Follow

    Best posts made by DIYD57519

    This user hasn't posted anything yet.

    Latest posts made by DIYD57519

    • RE: WebSocket V2 In on pong function==> b'\x00'

      @admin same issue. Do something to fix the issue. Dont just claim to recieve awards for API, in the web site.

      posted in Bugs
      D
      DIYD57519
    • RE: User Feedback - WebSocket 2.0 Beta Rollout – Python Language

      @J88913 dont install SmartApi. download and keep it in the same folder as program

      posted in Python SDK
      D
      DIYD57519
    • RE: User Feedback - WebSocket 2.0 Beta Rollout – Python Language

      @admin
      This script i not working. No error, nothing happens, It times out. Why ?
      I have tried many a times today.

      Code below:

      from SmartApi.smartWebSocketV2 import SmartWebSocketV2
      from smartapi import SmartConnect
      import pyotp

      obj=SmartConnect(api_key="") # feed app API key.
      #optional
      #access_token = "your access token",
      #refresh_token = "your refresh_token")
      #login api call
      token='
      '

      Login needs to be done through MPIN now.

      data = obj.generateSession("","",pyotp.TOTP(token).now())
      print(data)
      refreshToken= data['data']['refreshToken']
      jwt_token = data['data']['jwtToken']

      	#fetch the feedtoken
      

      feedToken=obj.getfeedToken()

      AUTH_TOKEN = jwt_token
      API_KEY = ******* #feed app API key
      CLIENT_CODE = '*******'
      FEED_TOKEN = feedToken

      correlation_id = "Testing"
      action = 1
      mode = 3

      token_list = [{"exchangeType": 1, "tokens": ["26009","11536","1594","2885"]}]

      sws = SmartWebSocketV2(AUTH_TOKEN, API_KEY, CLIENT_CODE, FEED_TOKEN)

      def on_data(wsapp, message):
      print("Ticks: {}".format(message))

      def on_open(wsapp):
      print("on open")

      sws.subscribe(correlation_id, mode, token_list)
      

      def on_error(wsapp, error):
      print(error)

      def on_close(wsapp):
      print("Close")

      Assign the callbacks.

      sws.on_open = on_open
      sws.on_data = on_data
      sws.on_error = on_error
      sws.on_close = on_close

      sws.connect()


      Rsult:

      on open

      posted in Python SDK
      D
      DIYD57519
    • RE: Streamer is not working

      @mohan1710 did you get this to work ? i have the same issue

      posted in Python SDK
      D
      DIYD57519
    • RE: Connection timeout Error

      is there any breakthrough on this one ?
      i am experiencing the same issue .

      script works otherwise from local system.
      oracle cloud vm has internet connection.
      it has a public ip assigned as well.
      python is able to connecr otherwise to internet.

      but smartapi connnection throws error.

      why ?

      posted in Python SDK
      D
      DIYD57519