Skip to content

How to parse responses #79

Open
Open
@ashwinkp

Description

@ashwinkp

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions