0.0
No commit activity in last 3 years
No release in over 3 years
Ruby wrapper for ReferralCandy API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 2.9.0

Runtime

>= 0.8.0
 Project Readme

ReferralCandy Ruby API Client

Installation

gem install 'referral_candy'

Usage

Initialization

Initialize a client with your ReferralCandy credentials

rc = ReferralCandy.new(:access_id => "YOUR_ACCESS_ID", :secret_key => "YOUR_SECRET_KEY")

Verification

Verify your credentials.

response = rc.verify
response.parsed_response # => {"message"=>"Verification Ok"}
response.code            # => 200

API Methods

The ReferralCandy API client will perform the authentication steps for you. This means that you would not be required to pass in the 'timestamp', 'accessID', and 'signature' parameters.

API endpoints are available as methods in the ReferralCandy API client.

E.g.

rc.contacts(:limit => 1).parsed_response
# => {"message"=>"Success", "total_count"=>10000, "contacts"=>[{"id"=>1, "first_name"=>"Yink", "last_name"=>"Teo", "email"=>"hello@referralcandy.com", "purchase_made"=>false, "purchases"=>[], "unsubscribed"=>true}]}

API Responses

The ReferralCandy API client uses HTTParty. API responses are wrapped in HTTParty::Response objects.

rc.verify.class           # => HTTParty::Response
rc.verify.body            # => "{\"message\":\"Verification Ok\"}"
rc.verify.parsed_response # => {"message"=>"Verification Ok"}
rc.verify.code            # => 200
rc.verify.header          # => #<Net::HTTPOK 200 OK readbody=true>

Documentation

API documentation