Successful webwrite, but empty response/output?

7 ビュー (過去 30 日間)
Paul Shoemaker
Paul Shoemaker 2019 年 8 月 23 日
回答済み: Paul Shoemaker 2019 年 8 月 24 日
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

採用された回答

Paul Shoemaker
Paul Shoemaker 2019 年 8 月 24 日
Hey all,
Seems like I stumbled into an echo chamber on this topic. I figured out how to get this to work. The solution can be found on this Matlab Answers entry (yes, I authored and answered that one, too!).
Paul S

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeJSON Format についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by