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

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet.

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it.

  • Fork the project.

  • Start a feature/bugfix branch.

  • Commit and push until you are happy with your contribution.

  • Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Kudos

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

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