Repository URL to install this package:
|
Version:
0.0.2 ▾
|
| lib |
| spec |
| .gitignore |
| Gemfile |
| Gemfile.lock |
| LICENSE.txt |
| README.md |
| Rakefile |
| market_sharp.gemspec |
A Ruby wrapper for the MarketSharp REST API.
Add this line to your application's Gemfile:
gem 'market_sharp'
And then execute:
$ bundle
Or install it yourself as:
$ gem install market_sharp
Before you can make calls to MarketSharp you must configure the library with a valid API Token. You can request a token be generated by MarketSharp. The API Token ties the API request to a particualr MarketSharp company id.
There are two ways to configure the gem. You can pass a hash of configuration options when you create a client, or you can use a configure block.
client = MarketSharp.client(company_id: 'YOUR_ACCOUNT_ID_HERE', user_key: 'YOUR_TOKEN_HERE', secret_key: 'YOUR_SECRET_HERE') Example request: params[:start_date] = 'SOME_DATE_IN_THE_PAST' (for sandbox account used to test the lastUpdated is in 2011 params[:end_date] = Date.today params[:sort_by] = 'lastUpdate' params[:sort_direction] = 'asc' customers = client.customers(params) transactions = client.transactions(params) customer = client.customer(id) contracts = client.contracts_by_job_id(job_id)
MarketSharp.configure do |config| config.api_token = "YOUR_TOKEN_HERE" end client = MarketSharp.client
git checkout -b my-new-feature)git commit -am 'Add some feature')git push origin my-new-feature)