/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.

I ❤️ Close.io, so if you have problems using the gem or would like to see support for new endpoints, please open a GitHub issue -- I'll get it resolved as quick as I can.

Installation

Add this line to your application's Gemfile:

  # in your Gemfile
  gem 'closeio', '~> 2.4'

  # then...
  bundle install

Usage

  client = Closeio::Client.new("api key")

  # Find a specific lead
  client.find_lead('lead_xxxxxxxxxxxx')

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

  # Find leads that match fields
  client.list_leads('custom.favorite_color:"cornflower blue"')

  # Create a lead
  client.create_lead(
    name: "Bluth Company",
    contacts: [{
      name: "Buster Bluth",
      emails: [{type: "office", email: "cartographer@bluthcompany.com"}]
    }]
  )

  # Saved Search (SmartView)
  smart_view = client.list_smart_views
  smart_views.leads

Options

You can disable the logger by passing in a second argument when creating a new client:

  client = Closeio::Client.new("api key", false)

Some servers running on SSL need specific configurations for the Faraday dependency. If you're running on Heroku with SSL enabled, you need to pass in the path of the CA certificate when creating a new client:

  client = Closeio::Client.new("api key", true, '/usr/lib/ssl/certs/ca-certificates.crt')

History

View the changelog This gem follows Semantic Versioning

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

Copyright

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