Class: SnapTrade::ConnectionsApi
- Inherits:
-
Object
- Object
- SnapTrade::ConnectionsApi
- Defined in:
- lib/snaptrade/api/connections_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#detail_brokerage_authorization(authorization_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Get connection detail.
-
#detail_brokerage_authorization_with_http_info(authorization_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Get connection detail.
-
#disable_brokerage_authorization(authorization_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Force disable connection.
-
#disable_brokerage_authorization_with_http_info(authorization_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Force disable connection.
-
#initialize(api_client = ApiClient.default) ⇒ ConnectionsApi
constructor
A new instance of ConnectionsApi.
-
#list_brokerage_authorizations(user_id:, user_secret:, extra: {}) ⇒ Object
List all connections.
-
#list_brokerage_authorizations_with_http_info(user_id:, user_secret:, extra: {}) ⇒ Object
List all connections.
-
#refresh_brokerage_authorization(authorization_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Refresh holdings for a connection.
-
#refresh_brokerage_authorization_with_http_info(authorization_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Refresh holdings for a connection.
-
#remove_brokerage_authorization(authorization_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Delete connection.
-
#remove_brokerage_authorization_with_http_info(authorization_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Delete connection.
-
#return_rates(user_id:, user_secret:, authorization_id:, extra: {}) ⇒ Object
List connection rate of returns.
-
#return_rates_with_http_info(user_id:, user_secret:, authorization_id:, extra: {}) ⇒ Object
List connection rate of returns.
-
#session_events(partner_client_id:, user_id: SENTINEL, session_id: SENTINEL, extra: {}) ⇒ Object
Get all session events for a user.
-
#session_events_with_http_info(partner_client_id:, user_id: SENTINEL, session_id: SENTINEL, extra: {}) ⇒ Object
Get all session events for a user.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ConnectionsApi
Returns a new instance of ConnectionsApi.
16 17 18 |
# File 'lib/snaptrade/api/connections_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/connections_api.rb', line 14 def api_client @api_client end |
Instance Method Details
#detail_brokerage_authorization(authorization_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Get connection detail
Returns a single connection for the specified ID.
28 29 30 31 |
# File 'lib/snaptrade/api/connections_api.rb', line 28 def (authorization_id:, user_id:, user_secret:, extra: {}) data, _status_code, _headers = (, user_id, user_secret, extra) data end |
#detail_brokerage_authorization_with_http_info(authorization_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Get connection detail
Returns a single connection for the specified ID.
41 42 43 |
# File 'lib/snaptrade/api/connections_api.rb', line 41 def (authorization_id:, user_id:, user_secret:, extra: {}) (, user_id, user_secret, extra) end |
#disable_brokerage_authorization(authorization_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Force disable connection
Manually force the specified connection to become disabled. This should only be used for testing a reconnect flow, and never used on production connections. Will trigger a disconnect as if it happened naturally, and send a [‘CONNECTION_BROKEN` webhook](/docs/webhooks#webhooks-connection_broken) for the connection.
This endpoint is available on test keys. If you would like it enabled on production keys as well, please contact support as it is disabled by default.
134 135 136 137 |
# File 'lib/snaptrade/api/connections_api.rb', line 134 def (authorization_id:, user_id:, user_secret:, extra: {}) data, _status_code, _headers = (, user_id, user_secret, extra) data end |
#disable_brokerage_authorization_with_http_info(authorization_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Force disable connection
Manually force the specified connection to become disabled. This should only be used for testing a reconnect flow, and never used on production connections. Will trigger a disconnect as if it happened naturally, and send a [‘CONNECTION_BROKEN` webhook](/docs/webhooks#webhooks-connection_broken) for the connection.
This endpoint is available on test keys. If you would like it enabled on production keys as well, please contact support as it is disabled by default.
150 151 152 |
# File 'lib/snaptrade/api/connections_api.rb', line 150 def (authorization_id:, user_id:, user_secret:, extra: {}) (, user_id, user_secret, extra) end |
#list_brokerage_authorizations(user_id:, user_secret:, extra: {}) ⇒ Object
List all connections
Returns a list of all connections for the specified user. Note that ‘Connection` and `Brokerage Authorization` are interchangeable, but the term `Connection` is preferred and used in the doc for consistency.
A connection is usually tied to a single login at a brokerage. A single connection can contain multiple brokerage accounts.
SnapTrade performs de-duping on connections for a given user. If the user has an existing connection with the brokerage, when connecting the brokerage with the same credentials, SnapTrade will return the existing connection instead of creating a new one.
243 244 245 246 |
# File 'lib/snaptrade/api/connections_api.rb', line 243 def (user_id:, user_secret:, extra: {}) data, _status_code, _headers = (user_id, user_secret, extra) data end |
#list_brokerage_authorizations_with_http_info(user_id:, user_secret:, extra: {}) ⇒ Object
List all connections
Returns a list of all connections for the specified user. Note that ‘Connection` and `Brokerage Authorization` are interchangeable, but the term `Connection` is preferred and used in the doc for consistency.
A connection is usually tied to a single login at a brokerage. A single connection can contain multiple brokerage accounts.
SnapTrade performs de-duping on connections for a given user. If the user has an existing connection with the brokerage, when connecting the brokerage with the same credentials, SnapTrade will return the existing connection instead of creating a new one.
259 260 261 |
# File 'lib/snaptrade/api/connections_api.rb', line 259 def (user_id:, user_secret:, extra: {}) (user_id, user_secret, extra) end |
#refresh_brokerage_authorization(authorization_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Refresh holdings for a connection
Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [‘ACCOUNT_HOLDINGS_UPDATED` webhook](/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. This endpoint will also trigger a transaction sync for the past day if one has not yet occurred.
**Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](dashboard.snaptrade.com/settings/billing)**
346 347 348 349 |
# File 'lib/snaptrade/api/connections_api.rb', line 346 def (authorization_id:, user_id:, user_secret:, extra: {}) data, _status_code, _headers = (, user_id, user_secret, extra) data end |
#refresh_brokerage_authorization_with_http_info(authorization_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Refresh holdings for a connection
Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [‘ACCOUNT_HOLDINGS_UPDATED` webhook](/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. This endpoint will also trigger a transaction sync for the past day if one has not yet occurred.
**Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](dashboard.snaptrade.com/settings/billing)**
362 363 364 |
# File 'lib/snaptrade/api/connections_api.rb', line 362 def (authorization_id:, user_id:, user_secret:, extra: {}) (, user_id, user_secret, extra) end |
#remove_brokerage_authorization(authorization_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Delete connection
Deletes the SnapTrade connection specified by the ID. This will also remove the accounts and holdings data associated with the connection from SnapTrade. This action is irreversible. This endpoint is synchronous, a 204 response indicates that the data has been successfully deleted.
452 453 454 455 |
# File 'lib/snaptrade/api/connections_api.rb', line 452 def (authorization_id:, user_id:, user_secret:, extra: {}) (, user_id, user_secret, extra) nil end |
#remove_brokerage_authorization_with_http_info(authorization_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Delete connection
Deletes the SnapTrade connection specified by the ID. This will also remove the accounts and holdings data associated with the connection from SnapTrade. This action is irreversible. This endpoint is synchronous, a 204 response indicates that the data has been successfully deleted.
465 466 467 |
# File 'lib/snaptrade/api/connections_api.rb', line 465 def (authorization_id:, user_id:, user_secret:, extra: {}) (, user_id, user_secret, extra) end |
#return_rates(user_id:, user_secret:, authorization_id:, extra: {}) ⇒ Object
List connection rate of returns
Returns a list of rate of return percents for a given connection. Will include timeframes available from the brokerage, for example “ALL”, “1Y”, “6M”, “3M”, “1M”
553 554 555 556 |
# File 'lib/snaptrade/api/connections_api.rb', line 553 def return_rates(user_id:, user_secret:, authorization_id:, extra: {}) data, _status_code, _headers = return_rates_with_http_info_impl(user_id, user_secret, , extra) data end |
#return_rates_with_http_info(user_id:, user_secret:, authorization_id:, extra: {}) ⇒ Object
List connection rate of returns
Returns a list of rate of return percents for a given connection. Will include timeframes available from the brokerage, for example “ALL”, “1Y”, “6M”, “3M”, “1M”
566 567 568 |
# File 'lib/snaptrade/api/connections_api.rb', line 566 def return_rates_with_http_info(user_id:, user_secret:, authorization_id:, extra: {}) return_rates_with_http_info_impl(user_id, user_secret, , extra) end |
#session_events(partner_client_id:, user_id: SENTINEL, session_id: SENTINEL, extra: {}) ⇒ Object
Get all session events for a user
Returns a list of session events associated with a user.
656 657 658 659 660 661 |
# File 'lib/snaptrade/api/connections_api.rb', line 656 def session_events(partner_client_id:, user_id: SENTINEL, session_id: SENTINEL, extra: {}) extra[:user_id] = user_id if user_id != SENTINEL extra[:session_id] = session_id if session_id != SENTINEL data, _status_code, _headers = session_events_with_http_info_impl(partner_client_id, extra) data end |
#session_events_with_http_info(partner_client_id:, user_id: SENTINEL, session_id: SENTINEL, extra: {}) ⇒ Object
Get all session events for a user
Returns a list of session events associated with a user.
671 672 673 674 675 |
# File 'lib/snaptrade/api/connections_api.rb', line 671 def session_events_with_http_info(partner_client_id:, user_id: SENTINEL, session_id: SENTINEL, extra: {}) extra[:user_id] = user_id if user_id != SENTINEL extra[:session_id] = session_id if session_id != SENTINEL session_events_with_http_info_impl(partner_client_id, extra) end |