A simple client wrapper for the Investec Open API.
Features:
- Authorize access via OAuth
- Retrieve accounts
- Retrieve transactions per account
Add this line to your application's Gemfile:
gem 'investec_open_api'And then execute:
$ bundle installOr install it yourself as:
$ gem install investec_open_apiCreate a new initializer called investec_open_api.rb in config/initializers:
InvestecOpenApi.configuration do |config|
config.api_username = "https://openapi.investec.com/"
config.api_password = "<Open API username>"
config.api_url = "<Open API password>"
endYou will need to register for Open API access. Follow the steps in Enrolment in the documentation.
To use the wrapper, create an instance of InvestecOpenApi::Client and then authenticate with your credentials:
client = InvestecOpenApi::Client.new
client.authenticate!Once authenticated you can retrieve your accounts:
accounts = client.accounts
my_account = accounts.firstUse the ID of one of your accounts to retrieve transactions:
client.transactions(my_account.id)The gem is available as open source under the terms of the MIT License.