Repository URL to install this package:
Version:
0.0.3 ▾
|
lib |
spec |
.gitignore |
Gemfile |
LICENSE.txt |
README.md |
Rakefile |
protractor.gemspec |
A Ruby wrapper for the Protractor REST API.
Add this line to your application's Gemfile:
gem 'protractor'
And then execute:
$ bundle
Or install it yourself as:
$ gem install protractor
Before you can make calls to Protractor you must configure the library with a valid API Token. You can request a token be generated by Protractor. The API Token ties the API request to a particualr Protractor 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 = Protractor.client(api_key: "YOUR_API_KEY", connection_id: "YOUR_CONNECTION_ID")
Protractor.configure do |config| config.api_key = "YOUR_API_KEY" config.connection_id = "YOUR_CONNECTION_ID" end client = Protractor.client
Option | Description |
---|---|
adapter | Which Faraday adapter to use |
api_key | Your 32 character Protractor API key |
api_version | Which version of the API to use (default: '1.0') |
connection_id | Your 32 character Protractor connection ID |
endpoint | Which API endpoint to use (default: 'GetCRMData.ashx') |
test_mode | Use the development API endpoint? |
Obtain a list of contacts from the Protractor API
If not set, the endDate is set to Time.now
.
# Get all contacts between March 25 and March 27, 2015 client.contacts(startDate: Time.new(2015, 3, 25), endDate: Time.new(2015, 3, 27)) # Get all contacts since March 25, 2015 client.contacts(startDate: Time.new(2015, 3, 25))
Obtain a list of invoices from the Protractor API
# Get all invoices between March 25 and March 27, 2015 client.invoices(startDate: Time.new(2015, 3, 25), endDate: Time.new(2015, 3, 27)) # Get all contacts since March 25, 2015 client.invoices(startDate: Time.new(2015, 3, 25))
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)