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
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Copyright
Copyright (c) 2013 Taylor Brooks. See LICENSE for details.