-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to parse responses #79
Comments
`def order_status(order_Id):
@ashwinkp |
even i am doing -> "order_Id= orderId ['Success']['NSE']['orderId']" |
I wrote a class KResponse. This allows me to get the orderID, Success and other info from the response string in structure format. So now I can do. class KResponse(object): def init(self, data): |
Hi,
I am able to place order what would be the best way to extract the order id from the response?
Currently the response has the structure
orderId = {'Success': {'NSE': {'message': 'Your AMO has been Placed: 12220207081042.', 'orderId': 12220207081042, 'price': 525, 'quantity': 1, 'tag': 'ALGO1'}}}
I am new to python so I am currently doing
order_Id= orderId ['Success']['NSE']['orderId']
which works but I suppose its not the best way to do...
A better way would have been if placer order sent a response of order_status type
where one could do
if order_status.status == 'Success'
print("Order ID: " order_status.status )
Any suggestions/comments?
TIA
Ashwin
The text was updated successfully, but these errors were encountered: