@gitchrisqueen/tdameritrade-api-js-client
Version:
TD Ameritrade API integration for node.js
116 lines (78 loc) • 3.5 kB
Markdown
All URIs are relative to *https://api.tdameritrade.com/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**accountsAccountIdGET**](AccountsApi.md
[**accountsGET**](AccountsApi.md
<a name="accountsAccountIdGET"></a>
> Account accountsAccountIdGET(accountId, opts)
Get Account
Account balances, positions, and orders for a specific account.
### Example
```javascript
var GitChrisQueen_TDA_JS = require('@gitchrisqueen/tdameritrade-api-js-client');
var defaultClient = GitChrisQueen_TDA_JS.ApiClient.instance;
// Configure API key authorization: bearerAuth
var bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearerAuth.apiKeyPrefix = 'Token';
var apiInstance = new GitChrisQueen_TDA_JS.AccountsApi();
var accountId = 56; // Number |
var opts = {
'fields': "fields_example" // String | Balances displayed by default, additional fields can be added here by adding positions or orders. Example: fields=positions,orders
};
apiInstance.accountsAccountIdGET(accountId, opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
```
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**accountId** | **Number**| |
**fields** | **String**| Balances displayed by default, additional fields can be added here by adding positions or orders. Example: fields=positions,orders | [optional]
[**Account**](Account.md)
[](../README.md
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="accountsGET"></a>
> Account accountsGET(opts)
Get Accounts
Account balances, positions, and orders for all linked accounts.
### Example
```javascript
var GitChrisQueen_TDA_JS = require('@gitchrisqueen/tdameritrade-api-js-client');
var defaultClient = GitChrisQueen_TDA_JS.ApiClient.instance;
// Configure API key authorization: bearerAuth
var bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearerAuth.apiKeyPrefix = 'Token';
var apiInstance = new GitChrisQueen_TDA_JS.AccountsApi();
var opts = {
'fields': "fields_example" // String | Balances displayed by default, additional fields can be added here by adding positions or orders. Example: fields=positions,orders
};
apiInstance.accountsGET(opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
```
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**fields** | **String**| Balances displayed by default, additional fields can be added here by adding positions or orders. Example: fields=positions,orders | [optional]
[**Account**](Account.md)
[](../README.md
- **Content-Type**: Not defined
- **Accept**: application/json