RubyRedtail

The gem provides access to methods to use the Redtail CRM API.

Installation

Add this line to your application’s Gemfile:

gem 'ruby-redtail'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ruby-redtail

Basic Setup

To setup the client, you’ll need the following configuration. In Rails land, you could create a file in ‘config/initializers/ruby-redtail.rb` (and if you’re still storing top secret keys in your code repository, take the opportunity now to stop and start using ENV vars or something):

RubyRedtail.configure do |config|
  config.api_key = ENV['REDTAIL_API_KEY']
  config.secret_key = ENV['REDTAIL_SECRET_KEY']
  config.api_uri = ENV['REDTAIL_API_URI']
end

Basic Usage

Authentication Options

Block-tastic!

RubyRedtail::User.authenticate_via_basic('frank', 'secret') do |redtail_user|
  # Something Cool
end
RubyRedtail::User.authenticate_via_user_key('key') do |redtail_user|
  # Something Cool
end
RubyRedtail::User.authenticate_via_user_token('token') do |redtail_user|
  # Something Cool
end

This works too:

redtail_user = RubyRedtail::User.new('Basic','frank', 'secret')
redtail_user = RubyRedtail::User.new('UserKey','key')
redtail_user = RubyRedtail::User.new('UserToken','token')

Fetching UserKey

redtail_user.user_key

Fetching Settings

redtail_user.settings.tag_groups

Fetching Contacts

redtail_user.contacts.search_by_name('Investor')

Contributing to RubyRedtail

Kudos

To @sampritipanda for his help in the creation of this gem.

Copyright © 2014 Nathan Colgate. See LICENSE.txt for further details.