2017 © Pedro Peláez
 

library loginradius

Login Radius PHP-SDK

image

xsanisty/loginradius

Login Radius PHP-SDK

  • Friday, November 1, 2013
  • by xsanisty
  • Repository
  • 1 Watchers
  • 0 Stars
  • 56 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 23 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

LoginRadius PHP SDK

This is the composer friendly fork of https://github.com/LoginRadius/PHP-SDK, (*1)

LoginRadius PHP SDK is a development kit that lets you integrate Social Login such as Facebook, Google, Twitter and over 20 more on a PHP website. The SDK also fetches user profile data and can be customized from your LoginRadius user account. Ex: social icon sets, login interface, provider settings, etc., (*2)

Installation

Just add "xsanisty/loginradius" : "dev-master" to "require" field in composer.json, (*3)

Example Code, (*4)

"require" : {
    "xsanisty/loginradius" : "dev-master"
}

Steps to call the library:, (*5)

 1. On the code behind of callback page, create an object of LoginRadius class and pass secret key and the token.
 2. If success, call getData method to get user's profile data.
   [For Premium paid plans: You can call getData method to get Extended user profile data.]
   visit the link for more information to get list of data: https://www.loginradius.com/product/user-profile-data

Sample code for authentication and get basic profile data, (*6)

PHP, (*7)

session_start();
require_once __DIR__.'/../vendor/autoload.php';
use LoginRadius\LoginRadius;

$secret = 'your-login-radius-secret';

//save token in session
if(isset($_POST['token'])){
    $_SESSION['token'] = $_POST['token'];
}else{
    $_SESSION['token'] = isset($_SESSION['token']) ? $_SESSION['token'] : '';
}

$token = $_SESSION['token'];

$loginRadius = new LoginRadius($secret, $token);
$userData = $loginRadius->getData();

Advance features (for Paid customers only)

LoginRadius generate a unique session token, when user logs in with any of social network. The lifetime of LoginRadius token is 15 mins, get/Save this Token to call this API., (*8)

LoginRadius Contacts API

You can use this API to fetch contacts from users social networks/email clients - Facebook, Twitter, LinkedIn, Google, Yahoo., (*9)

PHP, (*10)

$loginRadius->contact->getContacts();

LoginRadius Status API

PHP, (*11)

//post status
$response = $loginRadius->status->postStatus(array(
    'to' => '',
    'title' => '',
    'url' => '',
    'imageurl' => '',
    'status' => '',
    'caption' => '',
    'description' => ''
));

if($response === true){
    echo 'Message posted successfully.'; }
elseif(isset($response->errormessage)){
    echo $response->errormessage;
}else{
    echo 'Error in message post.';
}

//get status
$status = $loginRadius->status->getStatus();

LoginRadius Posts API

You can use this API to get posts from users social networks - Facebook, Twitter, LinkedIn, (*12)

PHP, (*13)

//get posts
$posts = $loginRadius->post->getPosts();

Get Twitter Mentions

You can use this API to get mentions from users social network - Twitter., (*14)

PHP, (*15)

$mentions = $loginRadius->status->getMentions();

Facebook Groups

You can use this API to get groups from users social network - Facebook., (*16)

PHP, (*17)

$groups = $loginRadius->group->getGroups();

Get LinkedIn follow companies

You can use this API to get followed companies list from users social network - LinkedIn., (*18)

PHP, (*19)

$companies = $loginRadius->company->getCompany();

LoginRadius direct message API

You can use this API to send direct message., (*20)

PHP, (*21)

$response = $loginRadius->message->sendMessage($to,$subject,$message);
if($response === true){
        echo 'Message sent successfully.';
}elseif(isset($response->errormessage)){
        echo $response->errormessage;
}else{
        echo 'Error in sending message.';
}

The Versions

01/11 2013

dev-master

9999999-dev

Login Radius PHP-SDK

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

19/10 2013

1.0.0

1.0.0.0

Login Radius PHP-SDK

  Sources   Download

MIT

The Requires

  • php >= 5.3.0