lib |
spec |
6y .gitignore |
6y Gemfile |
6y README.md |
6y field_locate_api.gemspec |
A Ruby wrapper for the FieldLocate REST API.
Add this line to your application's Gemfile:
gem 'field_locate_api'
And then execute:
$ bundle
Or install it yourself as:
$ gem install field_locate_api
Before you can make calls to FieldLocateApi you must configure the library with a valid API Token. You can request a token be generated by FieldLocateApi. The API Token ties the API request to a particular FieldLocateApi 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.
I) Passing hash of configuration.
client = FieldLocateApi.client({api_key: "YOUR_TOKEN_HERE"})
II) Using a configure block
FieldLocateApi.configure do |config| config.api_key = "YOUR_TOKEN_HERE" end client = FieldLocateApi.client
Logging can also be enabled by passing an optional logger.
Examples in a rails application logger = Rails.logger
with a custom logger logger = Logger.new("test.log")
client = FieldLocateApi.client({api_key: "YOUR_TOKEN_HERE", logger: logger})
or
FieldLocateApi.configure do |config| config.api_key = "YOUR_TOKEN_HERE" config.logger = logger end client = FieldLocateApi.client
client.customers({pageStartIndex: 0, pageSize: 100})
where
return a list of first 100 customers from 0 to 99
client.customers({pageStartIndex: 100, pageSize: 100})
where
return a list of 100 customers from 100 to 199
client.customers({pageNumber: 1, pageSize: 100})
where
return a list of first 100 customers from 0 to 99
client.customers({pageNumber: 2, pageSize: 100})
where
return a list of 100 customers from 100 to 199
client.customers
where
return a list of first 100 customers from 0 to 99
client.customers({pageSize: 50, pageStartIndex: 21})
where
will return total 50 customers starting from index 21 to 70.
client.customer('CUSTOMER_UUID_HERE')
client.invoices({pageStartIndex: 0, pageSize: 100})
where
return a list of first 100 invoices from 0 to 99
client.invoices({pageStartIndex: 100, pageSize: 100})
where
return a list of 100 invoices from 100 to 199
client.invoices({pageNumber: 1, pageSize: 100})
where
return a list of first 100 invoices from 0 to 99
client.invoices({pageNumber: 2, pageSize: 100})
where
return a list of 100 invoices from 100 to 199
client.invoices
where
return a list of first 100 invoices from 0 to 99
client.invoices({pageSize: 50, pageStartIndex: 21})
where
return total 50 invoices starting from index 21 to 70.
client.invoice('INVOICE_UUID_HERE')
client.agreements({pageStartIndex: 0, pageSize: 100})
where
return a list of first 100 agreements from 0 to 99
client.agreements({pageStartIndex: 100, pageSize: 100})
where
return a list of 100 agreements from 100 to 199
client.agreements({pageNumber: 1, pageSize: 100})
where
return a list of first 100 agreements from 0 to 99
client.agreements({pageNumber: 2, pageSize: 100})
where
return a list of 100 agreements from 100 to 199
client.agreements
where
return a list of first 100 agreements from 0 to 99
client.agreements({pageSize: 50, pageStartIndex: 21})
where
will return total 50 agreements starting from index 21 to 70.
client.agreement('AGREEMENT_UUID_HERE')
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)