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