Access API
A ruby wrapper for the Access API
Installation
gem 'access'
And then execute:
$ bundle
Or install it yourself as:
$ gem install access
Setup
Config setup
You can configure the following options:
access_token
Requiredformat
: Set as'json'
or'xml'
. Default is'json'
api_environment
: Set as'staging'
or'production'
. Default is'staging'
api_version
:'v1'
is default.hashify
Returns the results all using Hashie::Mash if'true'
, Default is'false'
Config via Environment Variables
You can set config settings by creating environment variables called:
ENV['ACCESS_TOKEN']
, ENV['ACCESS_FORMAT']
, ENV['ACCESS_ENVIRONMENT']
, ENV['ACCESS_VERSION']
, ENV['ACCESS_HASHIFY']
Config via Initializer
You can also create an initializer file to set up a config
Access.configure do |config|
config.access_token = ENV['ACCESS_TOKEN']
config.hashify = 'true'
end
You can also set them one at a time
Access.config.format = 'xml'
Making Calls
Offer
Access::Offer.search
Access::Offer.find **offer_key** options, member_key: **your-member-key**
Store
Access::Store.search
Access::Store.find store_key
Location
Access::Location.search
Access::Location.find location_key
Category
Access::Category.search
Access::Category.find key
Report
Access::Report.usage
Access::Report.usage token
Token
Access::Token.verify
Access::Token.verify_other token
Redeem
Access::Redeem.redeem_offer key nil options` *member_key required
Access::Redeem.redeem_offer key redeem_type options` *member_key required
Member
Contributing
- Fork it ( https://github.com/access-development/api-ruby/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