A example API client to LendKey FOM service. This utilizes rsa_authority
gem to authorize with service.
Add this line to your application's Gemfile:
gem 'api-fom-client'
And then execute:
$ bundle
Or install it yourself as:
$ gem install api-fom-client
You will need a client id and a rsa key to sign the call.
Configure to point to the correct endpoints with your client id and location to pem key to sign the requests. LendKey needs to know your client id and public key.
API::FOM::Client::Configuration.configure do |config|
config.private_key = 'my/private/key.pem'
config.client_id = 'my-ca23dse'
config.host = 'http://api.beybun.dev:3000'
end
Now you are ready to make calls to FOM service.
To find matching lenders in NJ, you need to make a call like this
criteria = {state_codes: ['NJ']}
lender_ids = []
query = API::FOM::Client::Query.execute(criteria, :fom, lender_ids)
=> query.query_id
13
=> query.results
=> [#<API::FOM::Client::Result:0x007feb7d53a028 @lender_id=118, @reason="I live in NJ">]
- Fork it ( https://github.com/metin/api-fom-client/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request