/closeio

A Ruby wrapper for the Close.io API

Primary LanguageRubyMIT LicenseMIT

A Ruby wrapper for the Close.IO API

Learn about the Closeio API at http://developer.close.io.

Installation

Add this line to your application's Gemfile:

  # in your Gemfile
  gem 'closeio'

  # then...
  bundle install

  # Set your Api Key (in a `config/initializer` or `config/environment/*`)
  Closeio.configure("xxxxxx")

Usage

  # Find a specific lead
  lead = Closeio::Lead.find 'lead_xxxxxxxxxxxx'

  # See some data about the lead
  lead.addresses
  lead.contacts
  lead.opportunities

  # Find leads that match fields
  Closeio::Lead.where query: 'custom.current_system:[Simple Donation]'

  # Create a lead
  Closeio::Lead.create name: "Bluth Company", contacts: [{name: "Buster Bluth", emails: [{type: "office", email: "cartographer@bluthcompany.com"}]}]

  # Saved Search (SmartView)
  saved_search = Closeio::SavedSearch.all.first
  saved_search.leads

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

Copyright

Copyright (c) 2013 Taylor Brooks. See LICENSE for details.