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
-
#delete_connection(connection_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Delete connection.
-
#delete_connection_with_http_info(connection_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Delete connection.
-
#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
#delete_connection(connection_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 asynchronous, a 200 response indicates that a task has been queued to delete the connection. Listen for the [‘CONNECTION_DELETED` webhook](docs.snaptrade.com/docs/webhooks#webhooks-connection_deleted) webhook to know when the deletion has been completed and the data has been removed.
28 29 30 31 |
# File 'lib/snaptrade/api/connections_api.rb', line 28 def delete_connection(connection_id:, user_id:, user_secret:, extra: {}) data, _status_code, _headers = delete_connection_with_http_info_impl(connection_id, user_id, user_secret, extra) data end |
#delete_connection_with_http_info(connection_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 asynchronous, a 200 response indicates that a task has been queued to delete the connection. Listen for the [‘CONNECTION_DELETED` webhook](docs.snaptrade.com/docs/webhooks#webhooks-connection_deleted) webhook to know when the deletion has been completed and the data has been removed.
41 42 43 |
# File 'lib/snaptrade/api/connections_api.rb', line 41 def delete_connection_with_http_info(connection_id:, user_id:, user_secret:, extra: {}) delete_connection_with_http_info_impl(connection_id, user_id, user_secret, extra) end |
#detail_brokerage_authorization(authorization_id:, user_id:, user_secret:, extra: {}) ⇒ Object
Get connection detail
Returns a single connection for the specified ID.
131 132 133 134 |
# File 'lib/snaptrade/api/connections_api.rb', line 131 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.
144 145 146 |
# File 'lib/snaptrade/api/connections_api.rb', line 144 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.
237 238 239 240 |
# File 'lib/snaptrade/api/connections_api.rb', line 237 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.
253 254 255 |
# File 'lib/snaptrade/api/connections_api.rb', line 253 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.
346 347 348 349 |
# File 'lib/snaptrade/api/connections_api.rb', line 346 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.
362 363 364 |
# File 'lib/snaptrade/api/connections_api.rb', line 362 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)** **Please note this endpoint is disabled for real-time plans (ex: PayGo). Real-time plans do not benefit from this feature since data is refreshed when calls are made**
450 451 452 453 |
# File 'lib/snaptrade/api/connections_api.rb', line 450 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)** **Please note this endpoint is disabled for real-time plans (ex: PayGo). Real-time plans do not benefit from this feature since data is refreshed when calls are made**
467 468 469 |
# File 'lib/snaptrade/api/connections_api.rb', line 467 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.
557 558 559 560 |
# File 'lib/snaptrade/api/connections_api.rb', line 557 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.
570 571 572 |
# File 'lib/snaptrade/api/connections_api.rb', line 570 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”
658 659 660 661 |
# File 'lib/snaptrade/api/connections_api.rb', line 658 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”
671 672 673 |
# File 'lib/snaptrade/api/connections_api.rb', line 671 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.
761 762 763 764 765 766 |
# File 'lib/snaptrade/api/connections_api.rb', line 761 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.
776 777 778 779 780 |
# File 'lib/snaptrade/api/connections_api.rb', line 776 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 |