Project

beeleads

0.0
No commit activity in last 3 years
No release in over 3 years
A Ruby interface to the Beeleads API.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
>= 0
~> 3.1.0

Runtime

 Project Readme

Beeleads

Build Status

A Ruby interface to the Beeleads API.

Installation

Add this line to your application's Gemfile:

gem 'beeleads'

And then execute:

$ bundle

Or install it yourself as:

$ gem install beeleads

Usage

In order to use Beeleads' Lead Integration API (version 1.0) make sure you have the following information:

  • Affiliate ID
  • API Secret
  • Offer ID

If you are missing any of this info, please contact suporte@beeleads.com.br.

require 'beeleads'
client = Beeleads::Client.new({:api_affiliate_id => ENV['API_AFFILIATE_ID'], :api_secret => ENV['API_SECRET'], :api_offer_id => ENV['API_OFFER_ID']})
response = client.lead({'email' => 'sample@example.net', 'firstname' => 'Tiago'})

The result has the following structure:

{
  "request" => {
    "time" => "2013-03-29 10:10:00",
    "data" => {
      "token" => "0d91dc50fc537bf975d91468efd381a1d8c250e1",
      "affiliate_id" => "1234",
      "offer_id" => "0",
      "field" => {
        "email" => "sample@example.net",
        "firstname" => "Tiago"
      }
    }
  },
  "response" => {
    "status" => 200,
    "message" => "OK"
    "data" => {
      "lead_id" => "573a872f9f68149b867dde997f5160f00f79cff3",
      "status"=>"PENDING_APPROVAL"
    }
  }
}

The response status codes can be:

  • 200 - OK
  • 400 - Invalid Request Data
  • 401 - Invalid Token
  • 500 - Internal Error

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request