Class: SnapTrade::TransactionsAndReportingApi
- Inherits:
-
Object
- Object
- SnapTrade::TransactionsAndReportingApi
- Defined in:
- lib/snaptrade/api/transactions_and_reporting_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_activities(user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, accounts: SENTINEL, brokerage_authorizations: SENTINEL, type: SENTINEL, extra: {}) ⇒ Object
Get transaction history for a user.
-
#get_activities_with_http_info(user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, accounts: SENTINEL, brokerage_authorizations: SENTINEL, type: SENTINEL, extra: {}) ⇒ Object
Get transaction history for a user.
-
#get_reporting_custom_range(start_date:, end_date:, user_id:, user_secret:, accounts: SENTINEL, detailed: SENTINEL, frequency: SENTINEL, extra: {}) ⇒ Object
Get performance information for a specific timeframe.
-
#get_reporting_custom_range_with_http_info(start_date:, end_date:, user_id:, user_secret:, accounts: SENTINEL, detailed: SENTINEL, frequency: SENTINEL, extra: {}) ⇒ Object
Get performance information for a specific timeframe.
-
#initialize(api_client = ApiClient.default) ⇒ TransactionsAndReportingApi
constructor
A new instance of TransactionsAndReportingApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ TransactionsAndReportingApi
Returns a new instance of TransactionsAndReportingApi.
16 17 18 |
# File 'lib/snaptrade/api/transactions_and_reporting_api.rb', line 16 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
14 15 16 |
# File 'lib/snaptrade/api/transactions_and_reporting_api.rb', line 14 def api_client @api_client end |
Instance Method Details
#get_activities(user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, accounts: SENTINEL, brokerage_authorizations: SENTINEL, type: SENTINEL, extra: {}) ⇒ Object
Get transaction history for a user
This endpoint is being deprecated but will continue to be available for use via SDKs, please use [the account level endpoint](/reference/Account%20Information/AccountInformation_getAccountActivities) if possible
Returns all historical transactions for the specified user and filtering criteria. It’s recommended to use ‘startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There’s a max number of 10000 transactions returned per request.
There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the ‘trade_date` field if you need them in a specific order.
The data returned here is always cached and refreshed once a day.
38 39 40 41 42 43 44 45 46 |
# File 'lib/snaptrade/api/transactions_and_reporting_api.rb', line 38 def get_activities(user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, accounts: SENTINEL, brokerage_authorizations: SENTINEL, type: SENTINEL, extra: {}) extra[:start_date] = start_date if start_date != SENTINEL extra[:end_date] = end_date if end_date != SENTINEL extra[:accounts] = accounts if accounts != SENTINEL extra[:brokerage_authorizations] = if != SENTINEL extra[:type] = type if type != SENTINEL data, _status_code, _headers = get_activities_with_http_info_impl(user_id, user_secret, extra) data end |
#get_activities_with_http_info(user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, accounts: SENTINEL, brokerage_authorizations: SENTINEL, type: SENTINEL, extra: {}) ⇒ Object
Get transaction history for a user
This endpoint is being deprecated but will continue to be available for use via SDKs, please use [the account level endpoint](/reference/Account%20Information/AccountInformation_getAccountActivities) if possible
Returns all historical transactions for the specified user and filtering criteria. It’s recommended to use ‘startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There’s a max number of 10000 transactions returned per request.
There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the ‘trade_date` field if you need them in a specific order.
The data returned here is always cached and refreshed once a day.
66 67 68 69 70 71 72 73 |
# File 'lib/snaptrade/api/transactions_and_reporting_api.rb', line 66 def get_activities_with_http_info(user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, accounts: SENTINEL, brokerage_authorizations: SENTINEL, type: SENTINEL, extra: {}) extra[:start_date] = start_date if start_date != SENTINEL extra[:end_date] = end_date if end_date != SENTINEL extra[:accounts] = accounts if accounts != SENTINEL extra[:brokerage_authorizations] = if != SENTINEL extra[:type] = type if type != SENTINEL get_activities_with_http_info_impl(user_id, user_secret, extra) end |
#get_reporting_custom_range(start_date:, end_date:, user_id:, user_secret:, accounts: SENTINEL, detailed: SENTINEL, frequency: SENTINEL, extra: {}) ⇒ Object
Get performance information for a specific timeframe
Returns performance information (contributions, dividends, rate of return, etc) for a specific timeframe. Please note that Total Equity Timeframe and Rate of Returns are experimental features. Please contact support@snaptrade.com if you notice any inconsistencies.
174 175 176 177 178 179 180 |
# File 'lib/snaptrade/api/transactions_and_reporting_api.rb', line 174 def get_reporting_custom_range(start_date:, end_date:, user_id:, user_secret:, accounts: SENTINEL, detailed: SENTINEL, frequency: SENTINEL, extra: {}) extra[:accounts] = accounts if accounts != SENTINEL extra[:detailed] = detailed if detailed != SENTINEL extra[:frequency] = frequency if frequency != SENTINEL data, _status_code, _headers = get_reporting_custom_range_with_http_info_impl(start_date, end_date, user_id, user_secret, extra) data end |
#get_reporting_custom_range_with_http_info(start_date:, end_date:, user_id:, user_secret:, accounts: SENTINEL, detailed: SENTINEL, frequency: SENTINEL, extra: {}) ⇒ Object
Get performance information for a specific timeframe
Returns performance information (contributions, dividends, rate of return, etc) for a specific timeframe. Please note that Total Equity Timeframe and Rate of Returns are experimental features. Please contact support@snaptrade.com if you notice any inconsistencies.
194 195 196 197 198 199 |
# File 'lib/snaptrade/api/transactions_and_reporting_api.rb', line 194 def get_reporting_custom_range_with_http_info(start_date:, end_date:, user_id:, user_secret:, accounts: SENTINEL, detailed: SENTINEL, frequency: SENTINEL, extra: {}) extra[:accounts] = accounts if accounts != SENTINEL extra[:detailed] = detailed if detailed != SENTINEL extra[:frequency] = frequency if frequency != SENTINEL get_reporting_custom_range_with_http_info_impl(start_date, end_date, user_id, user_secret, extra) end |