Build Status Code Climate

Access API

A ruby wrapper for the Access API

Installation

gem 'access', path: '../api-ruby'

And then execute:

$ bundle

Or install it yourself as:

$ gem install access

Setup

Config setup

You can configure the following options:

  • access_token Required
  • format 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"

You can set these buy creating environment variables called:

ENV['ACCESS_TOKEN'], ENV['ACCESS_FORMAT'], ENV['ACCESS_ENVIRONMENT'], ENV['ACCESS_VERSION'], ENV['ACCESS_HASHIFY']

or create an initializer file and set your 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 options Access::Offer.find offer_key options member_key required

Store

Access::Store.search options Access::Store.find store_key options

Location

Access::Location.search options Access::Location.find location_key options

Category

Access::Category.search options Access::Category.find key options

Report

Access::Report.usage options Access::Report.usage token options

Token

Access::Token.verify options Access::Token.verify_other token options

Redeem

Access::Redeem.redeem_offer key nil options member_key required Access::Redeem.redeem_offer key redeem_type options member_key required

Member

Contributing

  1. Fork it ( https://github.com/access-development/api-ruby/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request