This sample uses PHP to authenticate with the TradeStation WebAPI via an OAuth 2 Authorization Code Grant Type. The user will be directed to TradeStation's login page to capture credentials. After a successful login, an auth code is returned and is then exchanged for an access token which will be used for subsequent WebAPI calls.
Modify the following fields in gettoken.php with your appropriate values:
$apikey = ""; // set this to your API Key
$apisecret = ""; // set this to your API Secret
$baseurl = "https://sim.api.tradestation.com/v2/"; // change this to LIVE when you're ready: https://api.tradestation.com/v2/
If there are any problems, open an issue and we'll take a look! You can also give us feedback by e-mailing [email protected].