A Ruby wrapper for use with the MX Atrium API. In order to make requests, you will need to sign up for MX Atrium API and get a MX-API-KEY and MX-CLIENT-ID. Then, configure your instance with:
Atrium.configuredo |config|
config.mx_api_key=YOUR_API_KEYconfig.mx_client_id=YOUR_CLIENT_IDconfig.base_url="https://atrium.mx.com"# base_url is set to "https://vestibule.mx.com" by defaultendFrom there, you can start using some basic class methods to make calls for data. See our full documentation for more details.
The following demonstrates how you can read data back from the API in a memory efficient way using built-in pagination
helpers. You can also specify query parameters such as from_date and to_date.
::Atrium::User.list_eachdo |user|
user.each_memberdo |member|
putsmember.nameputsmember.accounts.total_entriesmember.each_accountdo |account|
putsaccount.nameputsaccount.transactions.total_entriesaccount.each_transactiondo |transaction|
putstransaction.descriptionendendenduser.each_accountdo |account|
putsaccount.nameputsaccount.transactions.total_entriesaccount.each_transactiondo |transaction|
putstransaction.descriptionendenduser.each_transactiondo |transaction|
putstransaction.descriptionendendYou can specify from_date and to_date to limit or widen your search. For example:
from_date= ::Date.new(2017,02,18)to_date= ::Date.new(2017,03,18)params={:from_date=>from_date,:to_date=>to_date}
::Atrium::Transaction.list_each(:user_guid=>"USR-123",:query_params=>params)do |transaction|
putstransaction.descriptionendAdd this line to your application's Gemfile:
gem'atrium-ruby'And then execute:
$ bundle
Or install it yourself as:
$ gem install atrium-ruby
Suggested implementation flow can be found in bin/demo comments. You can also use that as an executable for managing the settings and creating your own test flow to handle the requests and data with ./bin/demo
Bug reports and pull requests are welcome on GitHub at https://github.com/mxenabled/atrium-ruby.