class SnapTrade::AuthenticationApi

def delete_snap_trade_user(user_id:, extra: {})

Parameters:
  • extra (Hash) -- additional parameters to pass along through :header_params, :query_params, or parameter name
  • user_id (String) --
def delete_snap_trade_user(user_id:, extra: {})
  data, _status_code, _headers = delete_snap_trade_user_with_http_info_impl(user_id, extra)
  data
end

def delete_snap_trade_user_impl(user_id, opts = {})

Returns:
  • (DeleteUserResponse) -

Parameters:
  • opts (Hash) -- the optional parameters
  • user_id (String) --
def delete_snap_trade_user_impl(user_id, opts = {})
_status_code, _headers = delete_snap_trade_user_with_http_info(user_id, opts)

def delete_snap_trade_user_with_http_info(user_id:, extra: {})

Parameters:
  • extra (Hash) -- additional parameters to pass along through :header_params, :query_params, or parameter name
  • user_id (String) --
def delete_snap_trade_user_with_http_info(user_id:, extra: {})
  delete_snap_trade_user_with_http_info_impl(user_id, extra)
end

def delete_snap_trade_user_with_http_info_impl(user_id, opts = {})

Returns:
  • (Array<(DeleteUserResponse, Integer, Hash)>) - DeleteUserResponse data, response status code and response headers

Parameters:
  • opts (Hash) -- the optional parameters
  • user_id (String) --
def delete_snap_trade_user_with_http_info_impl(user_id, opts = {})
i_client.config.debugging
_client.config.logger.debug 'Calling API: AuthenticationApi.delete_snap_trade_user ...'
fy the required parameter 'user_id' is set
i_client.config.client_side_validation && user_id.nil?
 ArgumentError, "Missing the required parameter 'user_id' when calling AuthenticationApi.delete_snap_trade_user"
urce path
var_path = '/snapTrade/deleteUser'
y parameters
params = opts[:query_params] || {}
params[:'userId'] = user_id
er parameters
_params = opts[:header_params] || {}
 header 'Accept' (if needed)
_params['Accept'] = @api_client.select_header_accept(['application/json'])
 parameters
arams = opts[:form_params] || {}
 body (model)
ody = opts[:debug_body]
rn_type
_type = opts[:debug_return_type] || 'DeleteUserResponse'
_names
ames = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
tions = opts.merge(
ration => :"AuthenticationApi.delete_snap_trade_user",
der_params => header_params,
ry_params => query_params,
m_params => form_params,
y => post_body,
h_names => auth_names,
urn_type => return_type
status_code, headers, response = @api_client.call_api(:DELETE, local_var_path, new_options)
i_client.config.debugging
_client.config.logger.debug "API called: AuthenticationApi#delete_snap_trade_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
 data, status_code, headers, response

def initialize(api_client = ApiClient.default)

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

def list_snap_trade_users(extra: {})

Parameters:
  • extra (Hash) -- additional parameters to pass along through :header_params, :query_params, or parameter name
def list_snap_trade_users(extra: {})
  data, _status_code, _headers = list_snap_trade_users_with_http_info_impl(extra)
  data
end

def list_snap_trade_users_impl(opts = {})

Returns:
  • (Array) -

Parameters:
  • opts (Hash) -- the optional parameters
def list_snap_trade_users_impl(opts = {})
_status_code, _headers = list_snap_trade_users_with_http_info(opts)

def list_snap_trade_users_with_http_info(extra: {})

Parameters:
  • extra (Hash) -- additional parameters to pass along through :header_params, :query_params, or parameter name
def list_snap_trade_users_with_http_info(extra: {})
  list_snap_trade_users_with_http_info_impl(extra)
end

def list_snap_trade_users_with_http_info_impl(opts = {})

Returns:
  • (Array<(Array, Integer, Hash)>) - Array data, response status code and response headers

Parameters:
  • opts (Hash) -- the optional parameters
def list_snap_trade_users_with_http_info_impl(opts = {})
i_client.config.debugging
_client.config.logger.debug 'Calling API: AuthenticationApi.list_snap_trade_users ...'
urce path
var_path = '/snapTrade/listUsers'
y parameters
params = opts[:query_params] || {}
er parameters
_params = opts[:header_params] || {}
 header 'Accept' (if needed)
_params['Accept'] = @api_client.select_header_accept(['application/json'])
 parameters
arams = opts[:form_params] || {}
 body (model)
ody = opts[:debug_body]
rn_type
_type = opts[:debug_return_type] || 'Array<String>'
_names
ames = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
tions = opts.merge(
ration => :"AuthenticationApi.list_snap_trade_users",
der_params => header_params,
ry_params => query_params,
m_params => form_params,
y => post_body,
h_names => auth_names,
urn_type => return_type
status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
i_client.config.debugging
_client.config.logger.debug "API called: AuthenticationApi#list_snap_trade_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
 data, status_code, headers, response

def login_snap_trade_user(user_id:, user_secret:, broker: SENTINEL, immediate_redirect: SENTINEL, custom_redirect: SENTINEL, reconnect: SENTINEL, connection_type: 'read', connection_portal_version: 'v4', extra: {})

Parameters:
  • extra (Hash) -- additional parameters to pass along through :header_params, :query_params, or parameter name
  • body (SnapTradeLoginUserRequestBody) --
  • connection_portal_version (ConnectionPortalVersion) -- Sets the connection portal version to render. Currently only v4 is supported and is the default. All other versions are deprecated and will automatically be set to v4.
  • connection_type (ConnectionType) -- Sets whether the connection should be read-only or trade-enabled. Defaults to read-only if not specified.
  • reconnect (String) -- The UUID of the brokerage connection to be reconnected. This parameter should be left empty unless you are reconnecting a disabled connection. See the [guide on fixing broken connections](/docs/fix-broken-connections) for more information.
  • custom_redirect (String) -- URL to redirect the user to after the user connects their brokerage account. This parameter is ignored if the connection portal is loaded inside an iframe. See the [guide on ways to integrate the connection portal](/docs/implement-connection-portal) for more information.
  • immediate_redirect (Boolean) -- When set to `true`, user will be redirected back to the partner's site instead of the connection portal. This parameter is ignored if the connection portal is loaded inside an iframe. See the [guide on ways to integrate the connection portal](/docs/implement-connection-portal) for more information.
  • broker (String) -- Slug of the brokerage to connect the user to. See [the integrations page](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=3cfea70ef4254afc89704e47275a7a9a&pvs=4) for a list of supported brokerages and their slugs.
  • user_secret (String) --
  • user_id (String) --
def login_snap_trade_user(user_id:, user_secret:, broker: SENTINEL, immediate_redirect: SENTINEL, custom_redirect: SENTINEL, reconnect: SENTINEL, connection_type: 'read', connection_portal_version: 'v4', extra: {})
  _body = {}
  _body[:broker] = broker if broker != SENTINEL
  _body[:immediateRedirect] = immediate_redirect if immediate_redirect != SENTINEL
  _body[:customRedirect] = custom_redirect if custom_redirect != SENTINEL
  _body[:reconnect] = reconnect if reconnect != SENTINEL
  _body[:connectionType] = connection_type if connection_type != SENTINEL
  _body[:connectionPortalVersion] = connection_portal_version if connection_portal_version != SENTINEL
  extra[:snap_trade_login_user_request_body] = _body if !_body.empty?
  data, _status_code, _headers = login_snap_trade_user_with_http_info_impl(user_id, user_secret, extra)
  data
end

def login_snap_trade_user_impl(user_id, user_secret, opts = {})

Returns:
  • (AuthenticationLoginSnapTradeUser200Response) -

Options Hash: (**opts)
  • :snap_trade_login_user_request_body (SnapTradeLoginUserRequestBody) --

Parameters:
  • opts (Hash) -- the optional parameters
  • user_secret (String) --
  • user_id (String) --
def login_snap_trade_user_impl(user_id, user_secret, opts = {})
_status_code, _headers = login_snap_trade_user_with_http_info(user_id, user_secret, opts)

def login_snap_trade_user_with_http_info(user_id:, user_secret:, broker: SENTINEL, immediate_redirect: SENTINEL, custom_redirect: SENTINEL, reconnect: SENTINEL, connection_type: 'read', connection_portal_version: 'v4', extra: {})

Parameters:
  • extra (Hash) -- additional parameters to pass along through :header_params, :query_params, or parameter name
  • body (SnapTradeLoginUserRequestBody) --
  • connection_portal_version (ConnectionPortalVersion) -- Sets the connection portal version to render. Currently only v4 is supported and is the default. All other versions are deprecated and will automatically be set to v4.
  • connection_type (ConnectionType) -- Sets whether the connection should be read-only or trade-enabled. Defaults to read-only if not specified.
  • reconnect (String) -- The UUID of the brokerage connection to be reconnected. This parameter should be left empty unless you are reconnecting a disabled connection. See the [guide on fixing broken connections](/docs/fix-broken-connections) for more information.
  • custom_redirect (String) -- URL to redirect the user to after the user connects their brokerage account. This parameter is ignored if the connection portal is loaded inside an iframe. See the [guide on ways to integrate the connection portal](/docs/implement-connection-portal) for more information.
  • immediate_redirect (Boolean) -- When set to `true`, user will be redirected back to the partner's site instead of the connection portal. This parameter is ignored if the connection portal is loaded inside an iframe. See the [guide on ways to integrate the connection portal](/docs/implement-connection-portal) for more information.
  • broker (String) -- Slug of the brokerage to connect the user to. See [the integrations page](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=3cfea70ef4254afc89704e47275a7a9a&pvs=4) for a list of supported brokerages and their slugs.
  • user_secret (String) --
  • user_id (String) --
def login_snap_trade_user_with_http_info(user_id:, user_secret:, broker: SENTINEL, immediate_redirect: SENTINEL, custom_redirect: SENTINEL, reconnect: SENTINEL, connection_type: 'read', connection_portal_version: 'v4', extra: {})
  _body = {}
  _body[:broker] = broker if broker != SENTINEL
  _body[:immediateRedirect] = immediate_redirect if immediate_redirect != SENTINEL
  _body[:customRedirect] = custom_redirect if custom_redirect != SENTINEL
  _body[:reconnect] = reconnect if reconnect != SENTINEL
  _body[:connectionType] = connection_type if connection_type != SENTINEL
  _body[:connectionPortalVersion] = connection_portal_version if connection_portal_version != SENTINEL
  extra[:snap_trade_login_user_request_body] = _body if !_body.empty?
  login_snap_trade_user_with_http_info_impl(user_id, user_secret, extra)
end

def login_snap_trade_user_with_http_info_impl(user_id, user_secret, opts = {})

Returns:
  • (Array<(AuthenticationLoginSnapTradeUser200Response, Integer, Hash)>) - AuthenticationLoginSnapTradeUser200Response data, response status code and response headers

Options Hash: (**opts)
  • :snap_trade_login_user_request_body (SnapTradeLoginUserRequestBody) --

Parameters:
  • opts (Hash) -- the optional parameters
  • user_secret (String) --
  • user_id (String) --
def login_snap_trade_user_with_http_info_impl(user_id, user_secret, opts = {})
i_client.config.debugging
_client.config.logger.debug 'Calling API: AuthenticationApi.login_snap_trade_user ...'
fy the required parameter 'user_id' is set
i_client.config.client_side_validation && user_id.nil?
 ArgumentError, "Missing the required parameter 'user_id' when calling AuthenticationApi.login_snap_trade_user"
fy the required parameter 'user_secret' is set
i_client.config.client_side_validation && user_secret.nil?
 ArgumentError, "Missing the required parameter 'user_secret' when calling AuthenticationApi.login_snap_trade_user"
urce path
var_path = '/snapTrade/login'
y parameters
params = opts[:query_params] || {}
params[:'userId'] = user_id
params[:'userSecret'] = user_secret
er parameters
_params = opts[:header_params] || {}
 header 'Accept' (if needed)
_params['Accept'] = @api_client.select_header_accept(['application/json'])
 header 'Content-Type'
t_type = @api_client.select_header_content_type(['application/json'])
ntent_type.nil?
er_params['Content-Type'] = content_type
 parameters
arams = opts[:form_params] || {}
 body (model)
ody = opts[:debug_body] || @api_client.object_to_http_body(opts[:'snap_trade_login_user_request_body'])
rn_type
_type = opts[:debug_return_type] || 'AuthenticationLoginSnapTradeUser200Response'
_names
ames = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
tions = opts.merge(
ration => :"AuthenticationApi.login_snap_trade_user",
der_params => header_params,
ry_params => query_params,
m_params => form_params,
y => post_body,
h_names => auth_names,
urn_type => return_type
status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
i_client.config.debugging
_client.config.logger.debug "API called: AuthenticationApi#login_snap_trade_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
 data, status_code, headers, response

def register_snap_trade_user(user_id:, extra: {})

Parameters:
  • extra (Hash) -- additional parameters to pass along through :header_params, :query_params, or parameter name
  • body (SnapTradeRegisterUserRequestBody) --
  • user_id (String) -- SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable.
def register_snap_trade_user(user_id:, extra: {})
  _body = {}
  _body[:userId] = user_id if user_id != SENTINEL
  snap_trade_register_user_request_body = _body
  data, _status_code, _headers = register_snap_trade_user_with_http_info_impl(snap_trade_register_user_request_body, extra)
  data
end

def register_snap_trade_user_impl(snap_trade_register_user_request_body, opts = {})

Returns:
  • (UserIDandSecret) -

Parameters:
  • opts (Hash) -- the optional parameters
  • snap_trade_register_user_request_body (SnapTradeRegisterUserRequestBody) --
def register_snap_trade_user_impl(snap_trade_register_user_request_body, opts = {})
_status_code, _headers = register_snap_trade_user_with_http_info(snap_trade_register_user_request_body, opts)

def register_snap_trade_user_with_http_info(user_id:, extra: {})

Parameters:
  • extra (Hash) -- additional parameters to pass along through :header_params, :query_params, or parameter name
  • body (SnapTradeRegisterUserRequestBody) --
  • user_id (String) -- SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable.
def register_snap_trade_user_with_http_info(user_id:, extra: {})
  _body = {}
  _body[:userId] = user_id if user_id != SENTINEL
  snap_trade_register_user_request_body = _body
  register_snap_trade_user_with_http_info_impl(snap_trade_register_user_request_body, extra)
end

def register_snap_trade_user_with_http_info_impl(snap_trade_register_user_request_body, opts = {})

Returns:
  • (Array<(UserIDandSecret, Integer, Hash)>) - UserIDandSecret data, response status code and response headers

Parameters:
  • opts (Hash) -- the optional parameters
  • snap_trade_register_user_request_body (SnapTradeRegisterUserRequestBody) --
def register_snap_trade_user_with_http_info_impl(snap_trade_register_user_request_body, opts = {})
i_client.config.debugging
_client.config.logger.debug 'Calling API: AuthenticationApi.register_snap_trade_user ...'
fy the required parameter 'snap_trade_register_user_request_body' is set
i_client.config.client_side_validation && snap_trade_register_user_request_body.nil?
 ArgumentError, "Missing the required parameter 'snap_trade_register_user_request_body' when calling AuthenticationApi.register_snap_trade_user"
urce path
var_path = '/snapTrade/registerUser'
y parameters
params = opts[:query_params] || {}
er parameters
_params = opts[:header_params] || {}
 header 'Accept' (if needed)
_params['Accept'] = @api_client.select_header_accept(['application/json'])
 header 'Content-Type'
t_type = @api_client.select_header_content_type(['application/json'])
ntent_type.nil?
er_params['Content-Type'] = content_type
 parameters
arams = opts[:form_params] || {}
 body (model)
ody = opts[:debug_body] || @api_client.object_to_http_body(snap_trade_register_user_request_body)
rn_type
_type = opts[:debug_return_type] || 'UserIDandSecret'
_names
ames = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
tions = opts.merge(
ration => :"AuthenticationApi.register_snap_trade_user",
der_params => header_params,
ry_params => query_params,
m_params => form_params,
y => post_body,
h_names => auth_names,
urn_type => return_type
status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
i_client.config.debugging
_client.config.logger.debug "API called: AuthenticationApi#register_snap_trade_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
 data, status_code, headers, response

def reset_snap_trade_user_secret(user_id: SENTINEL, user_secret: SENTINEL, extra: {})

Parameters:
  • extra (Hash) -- additional parameters to pass along through :header_params, :query_params, or parameter name
  • body (UserIDandSecret) --
  • user_secret (String) -- SnapTrade User Secret. This is a randomly generated string and should be stored securely. If compromised, please rotate it via the [rotate user secret endpoint](/reference/Authentication/Authentication_resetSnapTradeUserSecret).
  • user_id (String) -- SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable.
def reset_snap_trade_user_secret(user_id: SENTINEL, user_secret: SENTINEL, extra: {})
  _body = {}
  _body[:userId] = user_id if user_id != SENTINEL
  _body[:userSecret] = user_secret if user_secret != SENTINEL
  user_i_dand_secret = _body
  data, _status_code, _headers = reset_snap_trade_user_secret_with_http_info_impl(user_i_dand_secret, extra)
  data
end

def reset_snap_trade_user_secret_impl(user_i_dand_secret, opts = {})

Returns:
  • (UserIDandSecret) -

Parameters:
  • opts (Hash) -- the optional parameters
  • user_i_dand_secret (UserIDandSecret) --
def reset_snap_trade_user_secret_impl(user_i_dand_secret, opts = {})
_status_code, _headers = reset_snap_trade_user_secret_with_http_info(user_i_dand_secret, opts)

def reset_snap_trade_user_secret_with_http_info(user_id: SENTINEL, user_secret: SENTINEL, extra: {})

Parameters:
  • extra (Hash) -- additional parameters to pass along through :header_params, :query_params, or parameter name
  • body (UserIDandSecret) --
  • user_secret (String) -- SnapTrade User Secret. This is a randomly generated string and should be stored securely. If compromised, please rotate it via the [rotate user secret endpoint](/reference/Authentication/Authentication_resetSnapTradeUserSecret).
  • user_id (String) -- SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable.
def reset_snap_trade_user_secret_with_http_info(user_id: SENTINEL, user_secret: SENTINEL, extra: {})
  _body = {}
  _body[:userId] = user_id if user_id != SENTINEL
  _body[:userSecret] = user_secret if user_secret != SENTINEL
  user_i_dand_secret = _body
  reset_snap_trade_user_secret_with_http_info_impl(user_i_dand_secret, extra)
end

def reset_snap_trade_user_secret_with_http_info_impl(user_i_dand_secret, opts = {})

Returns:
  • (Array<(UserIDandSecret, Integer, Hash)>) - UserIDandSecret data, response status code and response headers

Parameters:
  • opts (Hash) -- the optional parameters
  • user_i_dand_secret (UserIDandSecret) --
def reset_snap_trade_user_secret_with_http_info_impl(user_i_dand_secret, opts = {})
i_client.config.debugging
_client.config.logger.debug 'Calling API: AuthenticationApi.reset_snap_trade_user_secret ...'
fy the required parameter 'user_i_dand_secret' is set
i_client.config.client_side_validation && user_i_dand_secret.nil?
 ArgumentError, "Missing the required parameter 'user_i_dand_secret' when calling AuthenticationApi.reset_snap_trade_user_secret"
urce path
var_path = '/snapTrade/resetUserSecret'
y parameters
params = opts[:query_params] || {}
er parameters
_params = opts[:header_params] || {}
 header 'Accept' (if needed)
_params['Accept'] = @api_client.select_header_accept(['application/json'])
 header 'Content-Type'
t_type = @api_client.select_header_content_type(['application/json'])
ntent_type.nil?
er_params['Content-Type'] = content_type
 parameters
arams = opts[:form_params] || {}
 body (model)
ody = opts[:debug_body] || @api_client.object_to_http_body(user_i_dand_secret)
rn_type
_type = opts[:debug_return_type] || 'UserIDandSecret'
_names
ames = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
tions = opts.merge(
ration => :"AuthenticationApi.reset_snap_trade_user_secret",
der_params => header_params,
ry_params => query_params,
m_params => form_params,
y => post_body,
h_names => auth_names,
urn_type => return_type
status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
i_client.config.debugging
_client.config.logger.debug "API called: AuthenticationApi#reset_snap_trade_user_secret\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
 data, status_code, headers, response