Giter Site home page Giter Site logo

rapleaf-php5--5.0--5.1--5.2-'s Introduction

RAPLEAF DIRECT API FOR PHP 5.0, 5.1 and 5.2

Author: Angel S. Moreno ([email protected])

For general information regarding API, visit https://www.rapleaf.com/developers/api_docs/personalization/direct
The personalization API’s terms and conditions are stated at http://www.rapleaf.com/developers/api_usage

Background

This PHP Class was created because the PHP Lib provided by Rapleaf was not compatible with my PHP 5.2 server.

Requirements

  1. PHP 5
  2. cURL with SSL
  3. A Rapleaf API Key

Usage and examples

First you need to include the PHP file and instantiate RapleafApiPHP5 object by passing you api key:


include 'RapleafApiPHP5.php';
$api_key = 'YouAPIKeyHere';
$rpClient = new RapleafApiPHP5($api_key);

You now have access to the methods in the RapleafApiPHP5 class. Below are examples on how to use it:


//the email is case-crazy to show when doing a strtolower is needed
$email = '[email protected]';
$first_name = 'Angel';
$last_name = 'Moreno';
$street = '123 west no way street';
$city = 'Beverly Hills';
$state = 'CA';
$zip4 = '90210-1234';

//query_by_email
$response = $rpClient->query_by_email($email);

//query_by_email hashed
$response = $rpClient->query_by_email($email, true);

//query_by_md5
$response = $rpClient->query_by_md5(md5(strtolower($email)));

//query_by_sha1
$response = $rpClient->query_by_sha1(sha1(strtolower($email)));

//query_by_name_and_postal no email
$response = $rpClient->query_by_name_and_postal($first_name, $last_name, $street, $city, $state);

//query_by_name_and_postal with email
$response = $rpClient->query_by_name_and_postal($first_name, $last_name, $street, $city, $state, $email);

//query_by_name_and_zip no email
$response = $rpClient->query_by_name_and_zip($first_name, $last_name, $zip4);

//query_by_name_and_zip with email
$response = $rpClient->query_by_name_and_zip($first_name, $last_name, $zip4, $email);

rapleaf-php5--5.0--5.1--5.2-'s People

Contributors

angelxmoreno avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.