Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

customerlobby / field_edge_api   ruby

Repository URL to install this package:

  README.md

Field Edge

A Ruby wrapper for the Field Edge REST API.

Installation

Add this line to your application's Gemfile:

gem 'field_edge_api'

And then execute:

$ bundle

Or install it yourself as:

$ gem install field_edge_api

Usage

Configuration

Before you can make calls to FieldEdgeApi you must configure the library with a valid partner_key & company_key or a valid OAuth access token.

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.

Using an OAuth access token:

client = FieldEdgeApi.client(access_token: "YOUR_ACCESS_TOKEN_HERE")

Using a Basic access authentication:

FieldEdgeApi.configure do |config|
  config.partner_key = "YOUR_PARTNER KEY_HERE"
  config.company_key = "YOUR_COMPANY KEY_HERE"
end

Using OAuth access token

FieldEdgeApi.configure do |config|
  config.access_token = 'ACCESS_TOKEN'
end

Create FieldEdgeApi client

client = FieldEdgeApi.client

Get customers

get all the customers

client.customers

get specific customer details

client.customer('CUSTOMER_ID')

Use offset for pagination

client.customers(offset: 1)

filter customers by date

client.customers(afterLastModifiedDate: '2017-01-20T05:00:00Z')

Get transactions

get all the transactions

client.transactions

get specific transaction details

client.transaction('TRANSACTION_ID')

User offset for pagination

client.transactions(offset: 1)

filter transactions by date

client.transactions(afterTransactionDate: '2017-01-20T05:00:00Z')

Get Agreements

get all the agreements

client.agreements

get specific agreement details

client.agreement('AGREEMENT_ID')

User offset for pagination

client.agreements(offset: 1)

filter agreements by date

client.agreements(afterOriginalContractDate: '2017-01-20T05:00:00Z')

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request