To load the library, include the following code
require('rang.php'); $rang = new Rang('client_secret');
##Quickstart
###GET gift_token
$reference = 'xxxxxx' // Unique identifier for user $params = array(); $with_offers = FALSE; $gift_token = $rang->gift_token($reference, $params, $with_offers); print_r($gift_token);
###POST send_rewards_emails
####Single Email
$email = 'xxxxxx'; $params = array(); $email_response = $rang->send_rewards_emails($email, $params);
####Multiple emails
$emails = array('xxxxxxx', 'yyyyyy'); $params_array = array( 'xxxxxxx' => array(), 'yyyyyy' => array() ); $email_response = $rang->send_rewards_emails($emails, $params_array);
###POST claim_offer
$reference = 'xxxxxx' // Unique identifier for user $params = array(); $with_offers = FALSE; $gift_token = $rang->gift_token($reference, $params, $with_offers); $offer = $gift_token->offers[0]; $claim_response = $rang->claim_offer($gift_token->token, $offer->id); print_r($claim_response);
##Full Documentation http://developers.rang.com