Bwclient

TODO: Write a gem description

Installation

Add this line to your application's Gemfile:

gem 'bwclient'

And then execute:

$ bundle

Or install it yourself as:

$ gem install bwclient

Usage

Setup BW API ID in application, by adding "bw_api_id" variable in secrets.yml file with your BW API ID.

config/secrets.yml

development:
  bw_api_id: YOUR_BW_API_ID
production: 
  bw_api_id: YOUR_BW_API_ID

Method Calls :

  1. To create an account on BW:

    client = Bwclient::BwApi.new client.create_account(user_object)

Pass user object with "create_account" method.

Response will be in following JSON format for success and failure:

Success Response:

[
  {
    "status"=>201
  },
  {
    "message"=>"Account Created message",
    "acc_id"=>User account ID,
    "api_key"=>User Api key
  }
]

Failure Response:

[
  {
    "status"=>422
  },
  {
    "error"=>"Error Message"
  }
]

Contributing

  1. Fork it ( https://github.com/[my-github-username]/bwclient/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