Project

relateiq

0.01
No commit activity in last 3 years
No release in over 3 years
A lightweight ruby wrapper for the RelateIQ API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0

Runtime

 Project Readme

RelateIQ API Ruby Client

A ruby-based http client for the RelateIQ API

For the latest information on the API, look at:

##Usage Examples##

###Including the gem in your Gemfile###

gem 'relateiq'

###Initializing the client### Your api_key / api_secret is required to initialize the client. Refer to the "Requesting Access" section of RelateIQ's API documentation on how to set these.

RelateIQ.configure :api_key => YOUR_API_KEY,
                    :api_secret => YOUR_API_SECRET,
                    :base_url => "https://api.relateiq.com/v2"

###API methods###

Responses are returned as hashes.

Errors returned by the API will be raised as exceptions.

Examples:

You can make requests by invoking the lower level api methods get, post, and put on objects. See RelateIQ's API documentation for more information about the list of available resources/objects. Methods are called by simply passing in the URI of the resource you are accessing, along with any needed data as a hash object.

Create a contact:

contact = {
  :name=> [{:value=> "John Doe"}],
  :email=> [{:value=> "jd@example.com"}],
  :phone=> [{:value=> "555-555-5555"}],
  :address=> [{:value=> "123 Main St., San Francisco, CA 94103"}],
  :company=> [{:value=> "ABC Company"}],
  :title=> [{:value=> "CEO"}]
}

response = RelateIQ.post('/contacts', { :properties => contact })

Get a list of contacts:

response = RelateIQ.get('/contacts')