@admin same issue. Do something to fix the issue. Dont just claim to recieve awards for API, in the web site.
DIYD57519
@DIYD57519
Best posts made by DIYD57519
Latest posts made by DIYD57519
-
RE: WebSocket V2 In on pong function==> b'\x00'
-
RE: User Feedback - WebSocket 2.0 Beta Rollout – Python Language
@J88913 dont install SmartApi. download and keep it in the same folder as program
-
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 pyotpobj=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 = feedTokencorrelation_id = "Testing"
action = 1
mode = 3token_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_closesws.connect()
Rsult:
on open
-
RE: Streamer is not working
@mohan1710 did you get this to work ? i have the same issue
-
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 ?