Hey everyone,
I'm using webwrite to POST stock orders to TD Ameritrade using their API. For this to work, I need to define an authorization token in the header and provide the order details in json format. I'm able to successfully POST the order so that's not the issue. The problem I'm having is that I'd like to get the order number back from TD Ameritrade, but unfortunately webwrite--though successful--is returning an empty array (0x1 uint8). If I make this exact same request on TD Ameritrade's API web interface (i.e. using a browser), it shows a return like the one in the screenshot below.
The above info would be very useful in the webwrite output. The order number, which is what I'm looking for, is returned at the end of the "Location" line, in this example "2269145847." (Note that I've covered my account number on the "Location" line, hence the blank white space.)
My question is, how do I call webwrite or some other alternative such that information like that shown above is actually returned in Matlab instead of an empty response like I am getting right now?
Obviously, I don't want to have to manually use the TDA API via a web browser interface since that would defeat the purpose of automating in Matlab.
Thanks,
Paul S