class Ffiec::Client

Public Class Methods

new(username:, api_key:) click to toggle source

Return new Ffiec::Client, which is really a wrapper around Savon::Client

# File lib/ffiec/client.rb, line 7
def initialize(username:, api_key:)
  wsdl_endpoint = "https://cdr.ffiec.gov/Public/PWS/WebServices/RetrievalService.asmx?WSDL"
  @client = Savon.client(wsdl: wsdl_endpoint, wsse_auth: [username, api_key])
end

Public Instance Methods

available_commands() click to toggle source

Return array of commands that the WDL endpoint prescribes

# File lib/ffiec/client.rb, line 13
def available_commands
  return @client.operations
end
retrieve_facsimile(date:, format:, id:, id_type:) click to toggle source

Returns the web service response already decoded using Base64.decode64. The output is ready to be written to a file or processed inline. Accepted valued for parameters are:

date - (See output of :retrieve_reporting_periods method for acceptable values) format - Acceptable values: PDF, SDF (semicolon delimited format) and XBRL id_type - Acceptable values: FDICCertNumber, ID_RSSD, OCCChartNumber and OTSDockNumber id - The financial institution’s ID based on the enumerated fiIDType

# File lib/ffiec/client.rb, line 43
def retrieve_facsimile(date:, format:, id:, id_type:)
  response = @client.call(:retrieve_facsimile, message: {reportingPeriodEndDate: date, fiID: id, facsimileFormat: format, fiIDType: id_type})
  return Base64.decode64 response.body[:retrieve_facsimile_response][:retrieve_facsimile_result]
end
retrieve_filers_since_date() click to toggle source
# File lib/ffiec/client.rb, line 34
def retrieve_filers_since_date
end
retrieve_filers_submission_date_time() click to toggle source
# File lib/ffiec/client.rb, line 31
def retrieve_filers_submission_date_time
end
retrieve_panel_of_reporters(date:) click to toggle source

Return an array of hashes containing basic metadata for institutions that filed reports on a given reporting date.

Note: Many of the values returned within the hashes do not have proper spacing. It is recommended to use .strip and .squeeze to normalize values

# File lib/ffiec/client.rb, line 26
def retrieve_panel_of_reporters(date:)
  response = @client.call(:retrieve_panel_of_reporters, message: {reportingPeriodEndDate: date})
  return response.body[:retrieve_panel_of_reporters_response][:retrieve_panel_of_reporters_result][:reporting_financial_institution]
end
retrieve_reporting_periods() click to toggle source

Return array of strings that contain dates for which reports are available

# File lib/ffiec/client.rb, line 18
def retrieve_reporting_periods
  response = @client.call(:retrieve_reporting_periods)
  return response.body[:retrieve_reporting_periods_response][:retrieve_reporting_periods_result][:string]
end
retrieve_ubpr_reporting_periods() click to toggle source
# File lib/ffiec/client.rb, line 48
def retrieve_ubpr_reporting_periods
end
retrieve_ubprxbrl_facsimile() click to toggle source
# File lib/ffiec/client.rb, line 51
def retrieve_ubprxbrl_facsimile
end
test_user_access() click to toggle source

Returns boolean response stating whether a user has provided valid credentials

# File lib/ffiec/client.rb, line 55
def test_user_access
  response = @client.call(:test_user_access)
  return response.body[:test_user_access_response][:test_user_access_result]
end