Repository URL to install this package:
|
Version:
0.0.9 ▾
|
| lib |
| spec |
| .gitignore |
| CHANGELOG.txt |
| Gemfile |
| Gemfile.lock |
| LICENSE.txt |
| README.md |
| Rakefile |
| successware21_asp.gemspec |
A Ruby wrapper for the Successware21Asp REST API.
Add this line to your application's Gemfile:
gem 'successware21'
And then execute:
$ bundle
Or install it yourself as:
$ gem install successware21
Before you can make calls to Successware21Asp you must configure the library with a valid API Token. You can request a token be generated by Successware21Asp. The API Token ties the API request to a particular Successware21Asp company id.
To configure the gem pass a hash of configuration options when you create a client. Successware21 has a slightly unconventional API which means you have to get a connection_id, company_id and session_id before making requests. This is built into the gem so you can simply call the set_auth_params method as below. You must pass the full url for your instance including the port number as shown in the example below.
client = Successware21Asp.client({ agent_name: 'name', agent_password: 'password', master_id: 123, user_name: 'test user', user_password: 'test pass', company_id: 123, endpoint:'http://services.successware21.com:2142' }) client.set_auth_params
You can then retrieve resources using the following commands:
client.customers({date_time: '2010-01-01'}) client.transactions({date_time: '2010-01-01'})
Pagination is also enabled by passing an extra parameter like so:
client.customers({page_size_: 10, page_no: 1})
To end session/connection
client.end_session client.end_connection
Logging can also be enabled by passing an optional parameter
client = Successware21Asp.client({ agent_name: 'name',
agent_password: 'password',
master_id: 123,
user_name: 'test user',
user_password: 'test pass',
company_id: 123,
endpoint:'http://services.successware21.com:2142',
logging: true })
git checkout -b my-new-feature)git commit -am 'Add some feature')git push origin my-new-feature)