This is a simple Spring Boot 2 Application demonstrating a custom web service built on top of the TD-Ameritrade-Client for Java API.
- TDA Ameritrade Developer API Client ID and Token
- Java 8 runtime on path
mvn clean package
If you want to run for development purposes using e.g. mvn spring-boot:run
or in your IDE, then you should copy the file src/main/assembly/zip/config/application.properties to the src/main/resources folder
and modify any properties as needed.
If you then build the application and use the zipped version, then application.properties file that ends up in the config folder will override the properties that end up bundled in the jar from src/main/resources. See rules 14 and 15 in the Spring Boot Externalized Configuration section of the manual for more info.
The distro is located in target folder as td-ameritrade-java-client-demo-<version>.zip
Unzip this in a directory.
- Go into
config/application.properties
and set, at a minimum, thetda.client_id
andtda.token.refresh
properties. - Run
java -jar ./td-ameritrade-java-client-demo-<version>.jar
. - Import the client cert located at
X509/tda_client_1.p12
into your OS keystore or browser. All keystore, certificate, etc. passwords arepassword
. - You should be able to hit any api via your browser, e.g. https://localhost:443/api/v1/tda/quotes?symbols=msft.
- There are several curl scripts in
src/test/curl
which you can use for testing the REST calls.