@admin - this is resolved as the password format was float. just changed to str
thanks
@admin - this is resolved as the password format was float. just changed to str
thanks
@admin i have changed the password to MPIN but still i am getting the below error while fetching candle data
TypeError: {'success': False, 'message': 'Invalid Token', 'errorCode': 'AG8001', 'data': ''} has non list value for path data. Must be list or null.
please advise
thanks
Sukhwant
@admin hi,
not able to fetch smartApi.getCandleData(historicParam) for index tokens
62809 and 62808
please advice
thanks
@ravindra-e Thanks for the code.. Its working for me but it fails when I pass this token to next steps i.e.
smartApi.getProfile(refreshToken)
smartApi.generateToken(refreshToken)
Error is: Invalid json response.
My understanding is that he refresh token is valid until 5 AM next day, hence I can use the same refresh Token whenever I want to make API calls.
Please correct me if my understanding is wrong here. Thanks in advance
@admin any eta on the resolution of API issue?
@admin
I get below response from generateSession. I cant find any relevant for FEED_TOKEN.
{"status": True,
"message": "SUCCESS",
"errorcode": "",
"data": {
"clientcode": "XXXXXX",
"name": "XXXX YYYY",
"email": "",
"mobileno": "",
"exchanges": ["bse_cm", "nse_cm", "nse_fo"],
"products": ["BO", "NRML", "CO", "CNC", "MIS", "MARGIN"],
"lastlogintime": "",
"broker": "",
"jwtToken": "Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"refreshToken": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
}
Also, are you referring to below doc ? I cant find anything which explains which field to take from api response. Pleas advise
https://docs.google.com/document/d/1tZQzU2qNrB98eso6e6yqF3YxvXfK9cn5Xkzw_5jSJL8/edit
@admin - Thanks. Now I am using below in my code
AUTH_TOKEN -> jwtToken from response from generateSession('userid', 'password')
FEED_TOKEN -> refreshToken from response from generateSession('userid', 'password')
Please confirm if above is not correct, coz still I am getting same response from websockt i.e "Attempting to resubscribe/reconnect...
In on pong function==> b'\x00'"
I tried to troubleshoot from my end -> it failing at below step (i.e. row no 310 in smartWebsocketV2.py:
"token": SmartWebSocketV2._parse_token_value(binary_data[2:27]),
Can you help me here to understand whats wrong in my inputs ?
@Mnagesh - Below is the code form websocket vs 2
my question is from where do we get AUTH_TOKEN. I tried adding "Secret-Key" from "Apps & API" section (i.e. this link -> https://smartapi.angelbroking.com/apps) but I get below feeds from websocket.
Code
from SmartApi.smartWebSocketV2 import SmartWebSocketV2
AUTH_TOKEN = 'Bearer eyJhbGciOiJIUzU-w'
API_KEY = 'qwert'
CLIENT_CODE = 'X123456'
FEED_TOKEN = '00998877'
correlation_id = "nishant_123_qwerty"
action = 1
mode = 3
Websocket feed:
In on pong function==> b'\x00'
@admin - found answers to my question on documentation here https://drive.google.com/drive/u/0/folders/1GMwTMfxRdiloUziV4DYwlYchGXbOvTfL
follow up question : for AUTH_TOKEN, its mentioned (jwt auth token received from Login API). How do we generate auth token login api?
@admin I am not clear what needs to be entered in AUTH_TOKEN and correlation_id. Couldnt find anything on the documentation as well.
Please help
I have started the websocket for 2 tokens(lets say x & y) and I have started receiving feeds from the websocket. Now I want to add one more token to the list to start getting feeds for new token as well.
I tried ss.resubscribe method but nothing changes, I keep getting feeds for 2 tokens I initially provided.
@admin - can you help with above.
@admin - its still not resolved. do we have an eta for the smartapi to work smoothly, without disruption
thanks
sukhwant
@admin ignore got resolved now
i am getting same error as my pc got formatted, so installing again.
please provide solution
@admin please share the link. in documentation of SMARTAPI, under Rate Limits sections, Websockets are not mentioned
please opine
thanks
Sukhwant
hi @admin
what is the token limit to fetch data via websocket? as when i pass 2000 odd tokens on websocket, no response comes and when i pass 10 tokens, websocket gives me data
please opine
thanks
Sukhwant
@admin hi,
i have dropped a mail on Friday but no response yet. please opine
i am able to book buy order but not able to book Buy and Stop loss on that buy successfully using python api.
thnaks
hi @admin
i got clarity on point 1 of intraday - product type, will unwind the postion after 3.15 pm daily. so thats cool.
i need your guidance around while booking option trades via python ap., how we can put stoploss in the same order, as i am failing to do so. as mentioned in my orderparameters, i am able to book Buy option order but in stoploss field, even if i give a value. it books the order without taking stoploss value.
please assist. really appreciate if you tell me where i am going wrong
thanks
Sukhwant