loginradius/php-sdk-2.0

This package is abandoned and no longer maintained. The author suggests using the loginradius/php-sdk package instead.

LoginRadius PHP SDK v11.5.0

11.5.0 2023-01-20 05:51 UTC

README

Home Image

LoginRadius PHP wrapper provides access to LoginRadius.

LoginRadius is a unified Customer Identity Management API platform that combines 30 major social platforms into a single simplified and maintenance-free API. With LoginRadius' API, websites and mobile apps can implement capture user profile data, enable social login, enable social sharing, add single sign-on and many more.

LoginRadius helps businesses boost user engagement on their web/mobile platform, manage online identities, utilize social media for marketing, capture accurate consumer data and get unique social insight into their customer base.

PHP Library

Disclaimer


>This library is meant to help you with a quick implementation of the LoginRadius platform and also to serve as a reference point for the LoginRadius API. Keep in mind that it is an open source library, which means you are free to download and customize the library functions based on your specific application needs.

Installation

The recommended way to install is through Composer.

Install Composer

curl -sS https://getcomposer.org/installer | php

Next, run the Composer command to install the latest stable version of library:

composer require loginradius/php-sdk:11.5.0

Include the following files in your Project Directory

require_once "src/LoginRadiusSDK/Utility/Functions.php";
require_once "src/LoginRadiusSDK/Utility/SOTT.php";
require_once "src/LoginRadiusSDK/LoginRadiusException.php";
require_once "src/LoginRadiusSDK/Clients/IHttpClientInterface.php";
require_once "src/LoginRadiusSDK/Clients/DefaultHttpClient.php";

require_once "src/LoginRadiusSDK/CustomerRegistration/Authentication/AuthenticationAPI.php";
require_once "src/LoginRadiusSDK/CustomerRegistration/Authentication/OneTouchLoginAPI.php";
require_once "src/LoginRadiusSDK/CustomerRegistration/Authentication/PasswordLessLoginAPI.php";
require_once "src/LoginRadiusSDK/CustomerRegistration/Authentication/PhoneAuthenticationAPI.php";
require_once "src/LoginRadiusSDK/CustomerRegistration/Authentication/PINAuthenticationAPI.php";
require_once "src/LoginRadiusSDK/CustomerRegistration/Authentication/RiskBasedAuthenticationAPI.php";
require_once "src/LoginRadiusSDK/CustomerRegistration/Authentication/SmartLoginAPI.php";

require_once "src/LoginRadiusSDK/CustomerRegistration/Account/AccountAPI.php";
require_once "src/LoginRadiusSDK/CustomerRegistration/Account/RoleAPI.php";
require_once "src/LoginRadiusSDK/CustomerRegistration/Account/SottAPI.php";

require_once "src/LoginRadiusSDK/CustomerRegistration/Advanced/ConfigurationAPI.php";
require_once "src/LoginRadiusSDK/CustomerRegistration/Advanced/ConsentManagementAPI.php";
require_once "src/LoginRadiusSDK/CustomerRegistration/Advanced/CustomObjectAPI.php";
require_once "src/LoginRadiusSDK/CustomerRegistration/Advanced/MultiFactorAuthenticationAPI.php";
require_once "src/LoginRadiusSDK/CustomerRegistration/Advanced/ReAuthenticationAPI.php";
require_once "src/LoginRadiusSDK/CustomerRegistration/Advanced/WebHookAPI.php";

require_once "src/LoginRadiusSDK/CustomerRegistration/Social/NativeSocialAPI.php";
require_once "src/LoginRadiusSDK/CustomerRegistration/Social/SocialAPI.php";

Modify the config.php file in the SDK to include your LoginRadius Credentials

Quickstart Guide

Configuration

After successful install, you need to define the following LoginRadius Account info in your project anywhere before using the LoginRadius SDK or in the config file of your project:

define('APP_NAME', 'LOGINRADIUS_SITE_NAME_HERE'); // Replace LOGINRADIUS_SITE_NAME_HERE with your site name that provide in LoginRadius account.
define('LR_API_KEY', 'LOGINRADIUS_API_KEY_HERE'); // Replace LOGINRADIUS_API_KEY_HERE with your site API key that provide in LoginRadius account.
define('LR_API_SECRET', 'LOGINRADIUS_API_SECRET_HERE'); // Replace LOGINRADIUS_API_SECRET_HERE with your site Secret key that provide in LoginRadius account.

define('API_REQUEST_SIGNING', ''); // Pass boolean true if this option is enabled on you app.
define('API_REGION', ''); // Pass APi Region for your app
define('ORIGIN_IP', 'CLIENT_IP_ADDRESS');   // Replace CLIENT_IP_ADDRESS with the Client Ip Address,LoginRadius allows you add X-Origin-IP in your headers and it determines the IP address of the client's request,this can also be useful to overcome analytics discrepancies where the analytics depend on header data.

define('PROTOCOL', 'PROXY_PROTOCOL'); // Replace PROXY_PROTOCOL with your proxy server protocoal ie http or https.
define('HOST', 'PROXY_HOST'); // Replace PROXY_HOST with your proxy server host.
define('PORT', 'PROXY_PORT'); // Replace PROXY_PORT with your proxy server port.
define('USER', 'PROXY_USER'); // Replace PROXY_USER with your proxy server username.
define('PASSWORD', 'PROXY_PASSWORD'); // Replace PROXY_PASSWORD with your proxy server password.

define('API_DOMAIN', 'DEFINE_CUSTOM_API_DOMAIN');   // Custom API Domain
define('REFERER', 'DEFINE_REFERER');   // The referer header is used to determine the registration source from which the user has created the account and is synced in the RegistrationSource field for the user profile. When initializing the SDK, you can optionally specify Referer Header.

Replace 'LOGINRADIUS_SITE_NAME_HERE', 'LOGINRADIUS_API_KEY_HERE' and 'LOGINRADIUS_API_SECRET_HERE' in the above code with your LoginRadius Site Name, LoginRadius API Key, and Secret.This information can be found in your LoginRadius account as described here.

API Request Signing:- define('API_REQUEST_SIGNING', true); When initializing the SDK, you can optionally specify enabling this feature. Enabling this feature means the customer does not need to pass an API secret in an API request. Instead, they can pass a dynamically generated hash value. This feature will also make sure that the message is not tampered during transit when someone calls our APIs.

Pass the proxy configurations if you want to set Http Server Proxy Configuration through your PHP SDK. Protocol, Host and port are required to set Http Server Proxy configuration (username and password are optional).

If you have Custom API Domain then define 'API_DOMAIN' then replaced it with your custom API domain, Otherwise no need to define this option in configuration.

Implementation

Importing/aliasing with the use operator.

use \LoginRadiusSDK\Utility\Functions;
use \LoginRadiusSDK\Utility\SOTT;
use \LoginRadiusSDK\LoginRadiusException;
use \LoginRadiusSDK\Clients\IHttpClientInterface;
use \LoginRadiusSDK\Clients\DefaultHttpClient;
use \LoginRadiusSDK\CustomerRegistration\Account\AccountAPI;
use \LoginRadiusSDK\CustomerRegistration\Account\RoleAPI;
use \LoginRadiusSDK\CustomerRegistration\Account\SottAPI;
use \LoginRadiusSDK\CustomerRegistration\Advanced\ConfigurationAPI;
use \LoginRadiusSDK\CustomerRegistration\Advanced\ConsentManagementAPI;
use \LoginRadiusSDK\CustomerRegistration\Advanced\CustomObjectAPI;
use \LoginRadiusSDK\CustomerRegistration\Advanced\MultiFactorAuthenticationAPI;
use \LoginRadiusSDK\CustomerRegistration\Advanced\ReAuthenticationAPI;
use \LoginRadiusSDK\CustomerRegistration\Advanced\WebHookAPI;
use \LoginRadiusSDK\CustomerRegistration\Authentication\AuthenticationAPI;
use \LoginRadiusSDK\CustomerRegistration\Authentication\OneTouchLoginAPI;
use \LoginRadiusSDK\CustomerRegistration\Authentication\PasswordLessLoginAPI;
use \LoginRadiusSDK\CustomerRegistration\Authentication\PhoneAuthenticationAPI;
use \LoginRadiusSDK\CustomerRegistration\Authentication\PINAuthenticationAPI;
use \LoginRadiusSDK\CustomerRegistration\Authentication\RiskBasedAuthenticationAPI;
use \LoginRadiusSDK\CustomerRegistration\Authentication\SmartLoginAPI;
use \LoginRadiusSDK\CustomerRegistration\Social\SocialAPI;
use \LoginRadiusSDK\CustomerRegistration\Social\NativeSocialAPI;

Create a LoginRadius object :

$accountObject = new AccountAPI();

API Examples

Partial API response

We have an option to select fields(partial response) which you require as an API response.
For this, you need to pass an extra parameter(optional) at the end of each API function.

  • If any field passed does not exist in response, will be ignored.
  • In case of nested, only root object is selectable.
  • Values should be separated by the comma.

Example:

$fields= "email, username";
$email = 'xxxxxr@xxxxx.com';

$result = $accountObject->accountProfileByEmail($email,$fields);

Output Response:

{
    UserName: 'test1213',
    Email: [ { Type: 'Primary', Value: 'test1213@sthus.com' } ]
}

Authentication API

List of APIs in this Section:
PUT : Auth Update Profile by Token
PUT : Auth Unlock Account by Access Token
PUT : Auth Verify Email By OTP
PUT : Auth Reset Password by Security Answer and Email
PUT : Auth Reset Password by Security Answer and Phone
PUT : Auth Reset Password by Security Answer and UserName
PUT : Auth Reset Password by Reset Token
PUT : Auth Reset Password by OTP
PUT : Auth Reset Password by OTP and UserName
PUT : Auth Change Password
PUT : Auth Set or Change UserName
PUT : Auth Resend Email Verification
POST : Auth Add Email
POST : Auth Login by Email
POST : Auth Login by Username
POST : Auth Forgot Password
POST : Auth Link Social Identities
POST : Auth Link Social Identities By Ping
POST : Auth User Registration by Email
POST : Auth User Registration By Captcha
GET : Get Security Questions By Email
GET : Get Security Questions By UserName
GET : Get Security Questions By Phone
GET : Get Security Questions By Access Token
GET : Auth Validate Access token
GET : Access Token Invalidate
GET : Access Token Info
GET : Auth Read all Profiles by Token
GET : Auth Send Welcome Email
GET : Auth Delete Account
GET : Get Profile By Ping
GET : Auth Check Email Availability
GET : Auth Verify Email
GET : Auth Check UserName Availability
GET : Auth Privacy Policy Accept
GET : Auth Privacy Policy History By Access Token
DELETE : Auth Delete Account with Email Confirmation
DELETE : Auth Remove Email
DELETE : Auth Unlink Social Identities

If you have not already initialized the Authentication object do so now

$authenticationAPI = new AuthenticationAPI(); 
Auth Update Profile by Token (PUT)

This API is used to update the user's profile by passing the access token. More Info

$access_token = "access_token"; //Required
$payload = '{
"firstName" : "<firstName>",
"lastName" : "<lastName>"
}';  //Required 
$emailTemplate = "emailTemplate"; //Optional 
$fields = null; //Optional 
$nullSupport = "true"; //Optional 
$smsTemplate = "smsTemplate"; //Optional 
$verificationUrl = "verificationUrl"; //Optional

$result = $authenticationAPI->updateProfileByAccessToken($access_token,$payload,$emailTemplate,$fields,$nullSupport,$smsTemplate,$verificationUrl);
Auth Unlock Account by Access Token (PUT)

This API is used to allow a customer with a valid access token to unlock their account provided that they successfully pass the prompted Bot Protection challenges. The Block or Suspend block types are not applicable for this API. For additional details see our Auth Security Configuration documentation.You are only required to pass the Post Parameters that correspond to the prompted challenges. More Info

$access_token = "access_token"; //Required
$payload = '{
"g-recaptcha-response" : "<g-recaptcha-response>"
}';  //Required

$result = $authenticationAPI->unlockAccountByToken($access_token,$payload);
Auth Verify Email By OTP (PUT)

This API is used to verify the email of user when the OTP Email verification flow is enabled, please note that you must contact LoginRadius to have this feature enabled. More Info

$payload = '{
"email" : "<email>",
"otp" : "<otp>"
}';  //Required 
$fields = null; //Optional 
$url = "url"; //Optional 
$welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional

$result = $authenticationAPI->verifyEmailByOTP($payload,$fields,$url,$welcomeEmailTemplate);
Auth Reset Password by Security Answer and Email (PUT)

This API is used to reset password for the specified account by security question More Info

$payload = '{
"email" : "<email>",
"password" : "<password>",
"securityAnswer" : {"QuestionID":"Answer"}
}';  //Required

$result = $authenticationAPI->resetPasswordBySecurityAnswerAndEmail($payload);
Auth Reset Password by Security Answer and Phone (PUT)

This API is used to reset password for the specified account by security question More Info

$payload = '{
"password" : "<password>",
"phone" : "<phone>",
"securityAnswer" : {"QuestionID":"Answer"}
}';  //Required

$result = $authenticationAPI->resetPasswordBySecurityAnswerAndPhone($payload);
Auth Reset Password by Security Answer and UserName (PUT)

This API is used to reset password for the specified account by security question More Info

$payload = '{
"password" : "<password>",
"securityAnswer" : {"QuestionID":"Answer"},
"userName" : "<userName>"
}';  //Required

$result = $authenticationAPI->resetPasswordBySecurityAnswerAndUserName($payload);
Auth Reset Password by Reset Token (PUT)

This API is used to set a new password for the specified account. More Info

$payload = '{
"password" : "<password>",
"resetToken" : "<resetToken>"
}';  //Required

$result = $authenticationAPI->resetPasswordByResetToken($payload);
Auth Reset Password by OTP (PUT)

This API is used to set a new password for the specified account. More Info

$payload = '{
"email" : "<email>",
"otp" : "<otp>",
"password" : "<password>"
}';  //Required

$result = $authenticationAPI->resetPasswordByEmailOTP($payload);
Auth Reset Password by OTP and UserName (PUT)

This API is used to set a new password for the specified account if you are using the username as the unique identifier in your workflow More Info

$payload = '{
"otp" : "<otp>",
"password" : "<password>",
"userName" : "<userName>"
}';  //Required

$result = $authenticationAPI->resetPasswordByOTPAndUserName($payload);
Auth Change Password (PUT)

This API is used to change the accounts password based on the previous password More Info

$access_token = "access_token"; //Required 
$newPassword = "newPassword"; //Required 
$oldPassword = "oldPassword"; //Required

$result = $authenticationAPI->changePassword($access_token,$newPassword,$oldPassword);
Auth Set or Change UserName (PUT)

This API is used to set or change UserName by access token. More Info

$access_token = "access_token"; //Required 
$username = "username"; //Required

$result = $authenticationAPI->setOrChangeUserName($access_token,$username);
Auth Resend Email Verification (PUT)

This API resends the verification email to the user. More Info

$email = "email"; //Required 
$emailTemplate = "emailTemplate"; //Optional 
$verificationUrl = "verificationUrl"; //Optional

$result = $authenticationAPI->authResendEmailVerification($email,$emailTemplate,$verificationUrl);
Auth Add Email (POST)

This API is used to add additional emails to a user's account. More Info

$access_token = "access_token"; //Required 
$email = "email"; //Required 
$type = "type"; //Required 
$emailTemplate = "emailTemplate"; //Optional 
$verificationUrl = "verificationUrl"; //Optional

$result = $authenticationAPI->addEmail($access_token,$email,$type,$emailTemplate,$verificationUrl);
Auth Login by Email (POST)

This API retrieves a copy of the user data based on the Email More Info

$payload = '{
"email" : "<email>",
"password" : "<password>"
}';  //Required 
$emailTemplate = "emailTemplate"; //Optional 
$fields = null; //Optional 
$loginUrl = "loginUrl"; //Optional 
$verificationUrl = "verificationUrl"; //Optional

$result = $authenticationAPI->loginByEmail($payload,$emailTemplate,$fields,$loginUrl,$verificationUrl);
Auth Login by Username (POST)

This API retrieves a copy of the user data based on the Username More Info

$payload = '{
"password" : "<password>",
"username" : "<username>"
}';  //Required 
$emailTemplate = "emailTemplate"; //Optional 
$fields = null; //Optional 
$loginUrl = "loginUrl"; //Optional 
$verificationUrl = "verificationUrl"; //Optional

$result = $authenticationAPI->loginByUserName($payload,$emailTemplate,$fields,$loginUrl,$verificationUrl);
Auth Forgot Password (POST)

This API is used to send the reset password url to a specified account. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username' More Info

$email = "email"; //Required 
$resetPasswordUrl = "resetPasswordUrl"; //Required 
$emailTemplate = "emailTemplate"; //Optional

$result = $authenticationAPI->forgotPassword($email,$resetPasswordUrl,$emailTemplate);
Auth Link Social Identities (POST)

This API is used to link up a social provider account with an existing LoginRadius account on the basis of access token and the social providers user access token. More Info

$access_token = "access_token"; //Required 
$candidateToken = "candidateToken"; //Required

$result = $authenticationAPI->linkSocialIdentities($access_token,$candidateToken);
Auth Link Social Identities By Ping (POST)

This API is used to link up a social provider account with an existing LoginRadius account on the basis of ping and the social providers user access token. More Info

$access_token = "access_token"; //Required 
$clientGuid = "clientGuid"; //Required

$result = $authenticationAPI->linkSocialIdentitiesByPing($access_token,$clientGuid);
Auth User Registration by Email (POST)

This API creates a user in the database as well as sends a verification email to the user. More Info

$payload = '{
"email" : [   { 
"type" : "<type>"  ,
"value" : "<value>"   
}  ] ,
"firstName" : "<firstName>",
"lastName" : "<lastName>",
"password" : "<password>"
}';  //Required 
$sott = "sott"; //Required 
$emailTemplate = "emailTemplate"; //Optional 
$fields = null; //Optional 
$options = "options"; //Optional 
$verificationUrl = "verificationUrl"; //Optional 
$welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional

$result = $authenticationAPI->userRegistrationByEmail($payload,$sott,$emailTemplate,$fields,$options,$verificationUrl,$welcomeEmailTemplate);
Auth User Registration By Captcha (POST)

This API creates a user in the database as well as sends a verification email to the user. More Info

$payload = '{
"email" : [   { 
"type" : "<type>"  ,
"value" : "<value>"   
}  ] ,
"firstName" : "<firstName>",
"g-recaptcha-response" : "<g-recaptcha-response>",
"lastName" : "<lastName>",
"password" : "<password>"
}';  //Required 
$emailTemplate = "emailTemplate"; //Optional 
$fields = null; //Optional 
$options = "options"; //Optional 
$smsTemplate = "smsTemplate"; //Optional 
$verificationUrl = "verificationUrl"; //Optional 
$welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional

$result = $authenticationAPI->userRegistrationByCaptcha($payload,$emailTemplate,$fields,$options,$smsTemplate,$verificationUrl,$welcomeEmailTemplate);
Get Security Questions By Email (GET)

This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. More Info

$email = "email"; //Required

$result = $authenticationAPI->getSecurityQuestionsByEmail($email);
Get Security Questions By UserName (GET)

This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. More Info

$userName = "userName"; //Required

$result = $authenticationAPI->getSecurityQuestionsByUserName($userName);
Get Security Questions By Phone (GET)

This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. More Info

$phone = "phone"; //Required

$result = $authenticationAPI->getSecurityQuestionsByPhone($phone);
Get Security Questions By Access Token (GET)

This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. More Info

$access_token = "access_token"; //Required

$result = $authenticationAPI->getSecurityQuestionsByAccessToken($access_token);
Auth Validate Access token (GET)

This api validates access token, if valid then returns a response with its expiry otherwise error. More Info

$access_token = "access_token"; //Required

$result = $authenticationAPI->authValidateAccessToken($access_token);
Access Token Invalidate (GET)

This api call invalidates the active access token or expires an access token's validity. More Info

$access_token = "access_token"; //Required 
$preventRefresh = "true"; //Optional

$result = $authenticationAPI->authInValidateAccessToken($access_token,$preventRefresh);
Access Token Info (GET)

This api call provide the active access token Information More Info

$access_token = "access_token"; //Required

$result = $authenticationAPI->getAccessTokenInfo($access_token);
Auth Read all Profiles by Token (GET)

This API retrieves a copy of the user data based on the access token. More Info

$access_token = "access_token"; //Required 
$fields = null; //Optional 
$emailTemplate = "emailTemplate"; //Optional 
$verificationUrl = "verificationUrl"; //Optional 
$welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional

$result = $authenticationAPI->getProfileByAccessToken($access_token,$fields,$emailTemplate,$verificationUrl,$welcomeEmailTemplate);
Auth Send Welcome Email (GET)

This API sends a welcome email More Info

$access_token = "access_token"; //Required 
$welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional

$result = $authenticationAPI->sendWelcomeEmail($access_token,$welcomeEmailTemplate);
Auth Delete Account (GET)

This API is used to delete an account by passing it a delete token. More Info

$deletetoken = "deletetoken"; //Required

$result = $authenticationAPI->deleteAccountByDeleteToken($deletetoken);
Get Profile By Ping (GET)

This API is used to get a user's profile using the clientGuid parameter if no callback feature enabled.More Info

$clientGuid = "clientGuid"; //Required 
$emailTemplate = "emailTemplate"; //Optional 
$fields = null; //Optional 
$verificationUrl = "verificationUrl"; //Optional 
$welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional

$result = $authenticationAPI->getProfileByPing($clientGuid,$emailTemplate,$fields,$verificationUrl,$welcomeEmailTemplate);
Auth Check Email Availability (GET)

This API is used to check the email exists or not on your site. More Info

$email = "email"; //Required

$result = $authenticationAPI->checkEmailAvailability($email);
Auth Verify Email (GET)

This API is used to verify the email of user. Note: This API will only return the full profile if you have 'Enable auto login after email verification' set in your LoginRadius Admin Console's Email Workflow settings under 'Verification Email'. More Info

$verificationToken = "verificationToken"; //Required 
$fields = null; //Optional 
$url = "url"; //Optional 
$welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional

$result = $authenticationAPI->verifyEmail($verificationToken,$fields,$url,$welcomeEmailTemplate);
Auth Check UserName Availability (GET)

This API is used to check the UserName exists or not on your site. More Info

$username = "username"; //Required

$result = $authenticationAPI->checkUserNameAvailability($username);
Auth Privacy Policy Accept (GET)

This API is used to update the privacy policy stored in the user's profile by providing the access token of the user accepting the privacy policy More Info

$access_token = "access_token"; //Required 
$fields = null; //Optional

$result = $authenticationAPI->acceptPrivacyPolicy($access_token,$fields);
Auth Privacy Policy History By Access Token (GET)

This API will return all the accepted privacy policies for the user by providing the access token of that user. More Info

$access_token = "access_token"; //Required

$result = $authenticationAPI->getPrivacyPolicyHistoryByAccessToken($access_token);
Auth Delete Account with Email Confirmation (DELETE)

This API will send a confirmation email for account deletion to the customer's email when passed the customer's access token More Info

$access_token = "access_token"; //Required 
$deleteUrl = "deleteUrl"; //Optional 
$emailTemplate = "emailTemplate"; //Optional

$result = $authenticationAPI->deleteAccountWithEmailConfirmation($access_token,$deleteUrl,$emailTemplate);
Auth Remove Email (DELETE)

This API is used to remove additional emails from a user's account. More Info

$access_token = "access_token"; //Required 
$email = "email"; //Required

$result = $authenticationAPI->removeEmail($access_token,$email);
Auth Unlink Social Identities (DELETE)

This API is used to unlink up a social provider account with the specified account based on the access token and the social providers user access token. The unlinked account will automatically get removed from your database. More Info

$access_token = "access_token"; //Required 
$provider = "provider"; //Required 
$providerId = "providerId"; //Required

$result = $authenticationAPI->unlinkSocialIdentities($access_token,$provider,$providerId);

Account API

List of APIs in this Section:
PUT : Account Update
PUT : Update Phone ID by UID
PUT : Account Set Password
PUT : Account Invalidate Verification Email
PUT : Reset phone ID verification
PUT : Upsert Email
PUT : Update UID
POST : Account Create
POST : Forgot Password token
POST : Email Verification token
GET : Get Privacy Policy History By Uid
GET : Account Profiles by Email
GET : Account Profiles by Username
GET : Account Profile by Phone ID
GET : Account Profiles by UID
GET : Account Password
GET : Access Token based on UID or User impersonation API
GET : Refresh Access Token by Refresh Token
GET : Revoke Refresh Token
GET : Account Identities by Email
DELETE : Account Delete
DELETE : Account Remove Email
DELETE : Delete User Profiles By Email

If you have not already initialized the Account object do so now

$accountAPI = new AccountAPI(); 
Account Update (PUT)

This API is used to update the information of existing accounts in your Cloud Storage. See our Advanced API Usage section Here for more capabilities. More Info

$payload = '{
"firstName" : "<firstName>",
"lastName" : "<lastName>"
}';  //Required 
$uid = "uid"; //Required 
$fields = null; //Optional 
$nullSupport = "true"; //Optional

$result = $accountAPI->updateAccountByUid($payload,$uid,$fields,$nullSupport);
Update Phone ID by UID (PUT)

This API is used to update the PhoneId by using the Uid's. Admin can update the PhoneId's for both the verified and unverified profiles. It will directly replace the PhoneId and bypass the OTP verification process. More Info

$phone = "phone"; //Required 
$uid = "uid"; //Required 
$fields = null; //Optional

$result = $accountAPI->updatePhoneIDByUid($phone,$uid,$fields);
Account Set Password (PUT)

This API is used to set the password of an account in Cloud Storage. More Info

$password = "password"; //Required 
$uid = "uid"; //Required

$result = $accountAPI->setAccountPasswordByUid($password,$uid);
Account Invalidate Verification Email (PUT)

This API is used to invalidate the Email Verification status on an account. More Info

$uid = "uid"; //Required 
$emailTemplate = "emailTemplate"; //Optional 
$verificationUrl = "verificationUrl"; //Optional

$result = $accountAPI->invalidateAccountEmailVerification($uid,$emailTemplate,$verificationUrl);
Reset phone ID verification (PUT)

This API Allows you to reset the phone no verification of an end user’s account. More Info

$uid = "uid"; //Required 
$smsTemplate = "smsTemplate"; //Optional

$result = $accountAPI->resetPhoneIDVerificationByUid($uid,$smsTemplate);
Upsert Email (PUT)

This API is used to add/upsert another emails in account profile by different-different email types. If the email type is same then it will simply update the existing email, otherwise it will add a new email in Email array. More Info

$payload = '{
"email" : [   { 
"type" : "<type>"  ,
"value" : "<value>"   
}  ] 
}';  //Required 
$uid = "uid"; //Required 
$fields = null; //Optional

$result = $accountAPI->upsertEmail($payload,$uid,$fields);
Update UID (PUT)

This API is used to update a user's Uid. It will update all profiles, custom objects and consent management logs associated with the Uid. More Info

$payload = '{
"newUid" : "<newUid>"
}';  //Required 
$uid = "uid"; //Required

$result = $accountAPI->accountUpdateUid($payload,$uid);
Account Create (POST)

This API is used to create an account in Cloud Storage. This API bypass the normal email verification process and manually creates the user.

In order to use this API, you need to format a JSON request body with all of the mandatory fields More Info

$payload = '{
"email" : [   { 
"type" : "<type>"  ,
"value" : "<value>"   
}  ] ,
"firstName" : "<firstName>",
"lastName" : "<lastName>",
"password" : "<password>"
}';  //Required 
$fields = null; //Optional

$result = $accountAPI->createAccount($payload,$fields);
Forgot Password token (POST)

This API Returns a Forgot Password Token it can also be used to send a Forgot Password email to the customer. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username' in the body. More Info

$email = "email"; //Required 
$emailTemplate = "emailTemplate"; //Optional 
$resetPasswordUrl = "resetPasswordUrl"; //Optional 
$sendEmail = "true"; //Optional

$result = $accountAPI->getForgotPasswordToken($email,$emailTemplate,$resetPasswordUrl,$sendEmail);
Email Verification token (POST)

This API Returns an Email Verification token. More Info

$email = "email"; //Required

$result = $accountAPI->getEmailVerificationToken($email);
Get Privacy Policy History By Uid (GET)

This API is used to retrieve all of the accepted Policies by the user, associated with their UID. More Info

$uid = "uid"; //Required

$result = $accountAPI->getPrivacyPolicyHistoryByUid($uid);
Account Profiles by Email (GET)

This API is used to retrieve all of the profile data, associated with the specified account by email in Cloud Storage. More Info

$email = "email"; //Required 
$fields = null; //Optional

$result = $accountAPI->getAccountProfileByEmail($email,$fields);
Account Profiles by Username (GET)

This API is used to retrieve all of the profile data associated with the specified account by user name in Cloud Storage. More Info

$userName = "userName"; //Required 
$fields = null; //Optional

$result = $accountAPI->getAccountProfileByUserName($userName,$fields);
Account Profile by Phone ID (GET)

This API is used to retrieve all of the profile data, associated with the account by phone number in Cloud Storage. More Info

$phone = "phone"; //Required 
$fields = null; //Optional

$result = $accountAPI->getAccountProfileByPhone($phone,$fields);
Account Profiles by UID (GET)

This API is used to retrieve all of the profile data, associated with the account by uid in Cloud Storage. More Info

$uid = "uid"; //Required 
$fields = null; //Optional

$result = $accountAPI->getAccountProfileByUid($uid,$fields);
Account Password (GET)

This API use to retrive the hashed password of a specified account in Cloud Storage. More Info

$uid = "uid"; //Required

$result = $accountAPI->getAccountPasswordHashByUid($uid);
Access Token based on UID or User impersonation API (GET)

The API is used to get LoginRadius access token based on UID. More Info

$uid = "uid"; //Required

$result = $accountAPI->getAccessTokenByUid($uid);
Refresh Access Token by Refresh Token (GET)

This API is used to refresh an access token via it's associated refresh token. More Info

$refresh_Token = "refresh_Token"; //Required

$result = $accountAPI->refreshAccessTokenByRefreshToken($refresh_Token);
Revoke Refresh Token (GET)

The Revoke Refresh Access Token API is used to revoke a refresh token or the Provider Access Token, revoking an existing refresh token will invalidate the refresh token but the associated access token will work until the expiry. More Info

$refresh_Token = "refresh_Token"; //Required

$result = $accountAPI->revokeRefreshToken($refresh_Token);
Account Identities by Email (GET)

Note: This is intended for specific workflows where an email may be associated to multiple UIDs. This API is used to retrieve all of the identities (UID and Profiles), associated with a specified email in Cloud Storage. More Info

$email = "email"; //Required 
$fields = null; //Optional

$result = $accountAPI->getAccountIdentitiesByEmail($email,$fields);
Account Delete (DELETE)

This API deletes the Users account and allows them to re-register for a new account. More Info

$uid = "uid"; //Required

$result = $accountAPI->deleteAccountByUid($uid);
Account Remove Email (DELETE)

Use this API to Remove emails from a user Account More Info

$email = "email"; //Required 
$uid = "uid"; //Required 
$fields = null; //Optional

$result = $accountAPI->removeEmail($email,$uid,$fields);
Delete User Profiles By Email (DELETE)

This API is used to delete all user profiles associated with an Email. More Info

$email = "email"; //Required

$result = $accountAPI->accountDeleteByEmail($email);

Social API

List of APIs in this Section:
GET : Access Token
GET : Refresh Token
GET : Token Validate
GET : Access Token Invalidate
GET : Get Active Session Details
GET : Get Active Session By Account Id
GET : Get Active Session By Profile Id

If you have not already initialized the Social object do so now

$socialAPI = new SocialAPI(); 
Access Token (GET)

This API Is used to translate the Request Token returned during authentication into an Access Token that can be used with other API calls. More Info

$token = "token"; //Required

$result = $socialAPI->exchangeAccessToken($token);
Refresh Token (GET)

The Refresh Access Token API is used to refresh the provider access token after authentication. It will be valid for up to 60 days on LoginRadius depending on the provider. In order to use the access token in other APIs, always refresh the token using this API.

Supported Providers : Facebook,Yahoo,Google,Twitter, Linkedin.

Contact LoginRadius support team to enable this API. More Info

$access_Token = "access_Token"; //Required 
$expiresIn = 0; //Optional 
$isWeb = "true"; //Optional

$result = $socialAPI->refreshAccessToken($access_Token,$expiresIn,$isWeb);
Token Validate (GET)

This API validates access token, if valid then returns a response with its expiry otherwise error. More Info

$access_token = "access_token"; //Required

$result = $socialAPI->validateAccessToken($access_token);
Access Token Invalidate (GET)

This api invalidates the active access token or expires an access token validity. More Info

$access_token = "access_token"; //Required

$result = $socialAPI->inValidateAccessToken($access_token);
Get Active Session Details (GET)

This api is use to get all active session by Access Token. More Info

$token = "token"; //Required

$result = $socialAPI->getActiveSession($token);
Get Active Session By Account Id (GET)

This api is used to get all active sessions by AccountID(UID). More Info

$accountId = "accountId"; //Required

$result = $socialAPI->getActiveSessionByAccountID($accountId);
Get Active Session By Profile Id (GET)

This api is used to get all active sessions by ProfileId. More Info

$profileId = "profileId"; //Required

$result = $socialAPI->getActiveSessionByProfileID($profileId);

CustomObject API

List of APIs in this Section:
PUT : Custom Object Update by Access Token
PUT : Custom Object Update by UID
POST : Create Custom Object by Token
POST : Create Custom Object by UID
GET : Custom Object by Token
GET : Custom Object by ObjectRecordId and Token
GET : Custom Object By UID
GET : Custom Object by ObjectRecordId and UID
DELETE : Custom Object Delete by Record Id And Token
DELETE : Account Delete Custom Object by ObjectRecordId

If you have not already initialized the CustomObject object do so now

$customObjectAPI = new CustomObjectAPI(); 
Custom Object Update by Access Token (PUT)

This API is used to update the specified custom object data of the specified account. If the value of updatetype is 'replace' then it will fully replace custom object with the new custom object and if the value of updatetype is 'partialreplace' then it will perform an upsert type operation More Info

$access_token = "access_token"; //Required 
$objectName = "objectName"; //Required 
$objectRecordId = "objectRecordId"; //Required
$payload = '{"customdata1": "Store my customdata1 value" }';  //Required 
$updateType = "updateType"; //Optional

$result = $customObjectAPI->updateCustomObjectByToken($access_token,$objectName,$objectRecordId,$payload,$updateType);
Custom Object Update by UID (PUT)

This API is used to update the specified custom object data of a specified account. If the value of updatetype is 'replace' then it will fully replace custom object with new custom object and if the value of updatetype is partialreplace then it will perform an upsert type operation. More Info

$objectName = "objectName"; //Required 
$objectRecordId = "objectRecordId"; //Required
$payload = '{"customdata1": "Store my customdata1 value" }';  //Required 
$uid = "uid"; //Required 
$updateType = "updateType"; //Optional

$result = $customObjectAPI->updateCustomObjectByUid($objectName,$objectRecordId,$payload,$uid,$updateType);
Create Custom Object by Token (POST)

This API is used to write information in JSON format to the custom object for the specified account. More Info

$access_token = "access_token"; //Required 
$objectName = "objectName"; //Required
$payload = '{"customdata1": "Store my customdata1 value" }';  //Required

$result = $customObjectAPI->createCustomObjectByToken($access_token,$objectName,$payload);
Create Custom Object by UID (POST)

This API is used to write information in JSON format to the custom object for the specified account. More Info

$objectName = "objectName"; //Required
$payload = '{"customdata1": "Store my customdata1 value" }';  //Required 
$uid = "uid"; //Required

$result = $customObjectAPI->createCustomObjectByUid($objectName,$payload,$uid);
Custom Object by Token (GET)

This API is used to retrieve the specified Custom Object data for the specified account. More Info

$access_token = "access_token"; //Required 
$objectName = "objectName"; //Required

$result = $customObjectAPI->getCustomObjectByToken($access_token,$objectName);
Custom Object by ObjectRecordId and Token (GET)

This API is used to retrieve the Custom Object data for the specified account. More Info

$access_token = "access_token"; //Required 
$objectName = "objectName"; //Required 
$objectRecordId = "objectRecordId"; //Required

$result = $customObjectAPI->getCustomObjectByRecordIDAndToken($access_token,$objectName,$objectRecordId);
Custom Object By UID (GET)

This API is used to retrieve all the custom objects by UID from cloud storage. More Info

$objectName = "objectName"; //Required 
$uid = "uid"; //Required

$result = $customObjectAPI->getCustomObjectByUid($objectName,$uid);
Custom Object by ObjectRecordId and UID (GET)

This API is used to retrieve the Custom Object data for the specified account. More Info

$objectName = "objectName"; //Required 
$objectRecordId = "objectRecordId"; //Required 
$uid = "uid"; //Required

$result = $customObjectAPI->getCustomObjectByRecordID($objectName,$objectRecordId,$uid);
Custom Object Delete by Record Id And Token (DELETE)

This API is used to remove the specified Custom Object data using ObjectRecordId of a specified account. More Info

$access_token = "access_token"; //Required 
$objectName = "objectName"; //Required 
$objectRecordId = "objectRecordId"; //Required

$result = $customObjectAPI->deleteCustomObjectByToken($access_token,$objectName,$objectRecordId);
Account Delete Custom Object by ObjectRecordId (DELETE)

This API is used to remove the specified Custom Object data using ObjectRecordId of specified account. More Info

$objectName = "objectName"; //Required 
$objectRecordId = "objectRecordId"; //Required 
$uid = "uid"; //Required

$result = $customObjectAPI->deleteCustomObjectByRecordID($objectName,$objectRecordId,$uid);

PhoneAuthentication API

List of APIs in this Section:
PUT : Phone Reset Password by OTP
PUT : Phone Verification OTP
PUT : Phone Verification OTP by Token
PUT : Phone Number Update
POST : Phone Login
POST : Phone Forgot Password by OTP
POST : Phone Resend Verification OTP
POST : Phone Resend Verification OTP By Token
POST : Phone User Registration by SMS
GET : Phone Number Availability
DELETE : Remove Phone ID by Access Token

If you have not already initialized the PhoneAuthentication object do so now

$phoneAuthenticationAPI = new PhoneAuthenticationAPI(); 
Phone Reset Password by OTP (PUT)

This API is used to reset the password More Info

$payload = '{
"otp" : "<otp>",
"password" : "<password>",
"phone" : "<phone>"
}';  //Required

$result = $phoneAuthenticationAPI->resetPasswordByPhoneOTP($payload);
Phone Verification OTP (PUT)

This API is used to validate the verification code sent to verify a user's phone number More Info

$otp = "otp"; //Required 
$phone = "phone"; //Required 
$fields = null; //Optional 
$smsTemplate = "smsTemplate"; //Optional

$result = $phoneAuthenticationAPI->phoneVerificationByOTP($otp,$phone,$fields,$smsTemplate);
Phone Verification OTP by Token (PUT)

This API is used to consume the verification code sent to verify a user's phone number. Use this call for front-end purposes in cases where the user is already logged in by passing the user's access token. More Info

$access_token = "access_token"; //Required 
$otp = "otp"; //Required 
$smsTemplate = "smsTemplate"; //Optional

$result = $phoneAuthenticationAPI->phoneVerificationOTPByAccessToken($access_token,$otp,$smsTemplate);
Phone Number Update (PUT)

This API is used to update the login Phone Number of users More Info

$access_token = "access_token"; //Required 
$phone = "phone"; //Required 
$smsTemplate = "smsTemplate"; //Optional

$result = $phoneAuthenticationAPI->updatePhoneNumber($access_token,$phone,$smsTemplate);
Phone Login (POST)

This API retrieves a copy of the user data based on the Phone More Info

$payload = '{
"password" : "<password>",
"phone" : "<phone>"
}';  //Required 
$fields = null; //Optional 
$loginUrl = "loginUrl"; //Optional 
$smsTemplate = "smsTemplate"; //Optional

$result = $phoneAuthenticationAPI->loginByPhone($payload,$fields,$loginUrl,$smsTemplate);
Phone Forgot Password by OTP (POST)

This API is used to send the OTP to reset the account password. More Info

$phone = "phone"; //Required 
$smsTemplate = "smsTemplate"; //Optional

$result = $phoneAuthenticationAPI->forgotPasswordByPhoneOTP($phone,$smsTemplate);
Phone Resend Verification OTP (POST)

This API is used to resend a verification OTP to verify a user's Phone Number. The user will receive a verification code that they will need to input More Info

$phone = "phone"; //Required 
$smsTemplate = "smsTemplate"; //Optional

$result = $phoneAuthenticationAPI->phoneResendVerificationOTP($phone,$smsTemplate);
Phone Resend Verification OTP By Token (POST)

This API is used to resend a verification OTP to verify a user's Phone Number in cases in which an active token already exists More Info

$access_token = "access_token"; //Required 
$phone = "phone"; //Required 
$smsTemplate = "smsTemplate"; //Optional

$result = $phoneAuthenticationAPI->phoneResendVerificationOTPByToken($access_token,$phone,$smsTemplate);
Phone User Registration by SMS (POST)

This API registers the new users into your Cloud Storage and triggers the phone verification process. More Info

$payload = '{
"email" : [   { 
"type" : "<type>"  ,
"value" : "<value>"   
}] ,
"firstName" : "<firstName>",
"lastName" : "<lastName>",
"password" : "<password>",
"phoneId" : "<phoneId>"
}';  //Required 
$sott = "sott"; //Required 
$fields = null; //Optional 
$options = "options"; //Optional 
$smsTemplate = "smsTemplate"; //Optional 
$verificationUrl = "verificationUrl"; //Optional 
$welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional
$emailTemplate = "emailTemplate"; //Optional
$result = $phoneAuthenticationAPI->userRegistrationByPhone($payload,$sott,$fields,$options,$smsTemplate,$verificationUrl,$welcomeEmailTemplate,$emailTemplate);
Phone Number Availability (GET)

This API is used to check the Phone Number exists or not on your site. More Info

$phone = "phone"; //Required

$result = $phoneAuthenticationAPI->checkPhoneNumberAvailability($phone);
Remove Phone ID by Access Token (DELETE)

This API is used to delete the Phone ID on a user's account via the access token More Info

$access_token = "access_token"; //Required

$result = $phoneAuthenticationAPI->removePhoneIDByAccessToken($access_token);

MultiFactorAuthentication API

List of APIs in this Section:
PUT : Update MFA Setting
PUT : Update MFA by Access Token
PUT : MFA Update Phone Number by Token
PUT : Verify MFA Email OTP by Access Token
PUT : Update MFA Security Question by Access Token
PUT : MFA Validate OTP
PUT : MFA Validate Google Auth Code
PUT : MFA Validate Backup code
PUT : MFA Update Phone Number
PUT : Verify MFA Email OTP by MFA Token
PUT : Update MFA Security Question by MFA Token
POST : MFA Email Login
POST : MFA UserName Login
POST : MFA Phone Login
POST : Send MFA Email OTP by MFA Token
POST : Verify MFA Security Question by MFA Token
GET : MFA Validate Access Token
GET : MFA Backup Code by Access Token
GET : Reset Backup Code by Access Token
GET : Send MFA Email OTP by Access Token
GET : MFA Resend Otp
GET : MFA Backup Code by UID
GET : MFA Reset Backup Code by UID
DELETE : MFA Reset Google Authenticator by Token
DELETE : MFA Reset SMS Authenticator by Token
DELETE : Reset MFA Email OTP Authenticator By Access Token
DELETE : MFA Reset Security Question Authenticator By Access Token
DELETE : MFA Reset SMS Authenticator By UID
DELETE : MFA Reset Google Authenticator By UID
DELETE : Reset MFA Email OTP Authenticator Settings by Uid
DELETE : Reset MFA Security Question Authenticator Settings by Uid

If you have not already initialized the MultiFactorAuthentication object do so now

$multiFactorAuthenticationAPI = new MultiFactorAuthenticationAPI(); 
Update MFA Setting (PUT)

This API is used to trigger the Multi-factor authentication settings after login for secure actions More Info

$access_token = "access_token"; //Required
$payload = '{
"otp" : "<otp>"
}';  //Required 
$fields = null; //Optional

$result = $multiFactorAuthenticationAPI->mfaUpdateSetting($access_token,$payload,$fields);
Update MFA by Access Token (PUT)

This API is used to Enable Multi-factor authentication by access token on user login More Info

$access_token = "access_token"; //Required
$payload = '{
"googleAuthenticatorCode" : "<googleAuthenticatorCode>"
}';  //Required 
$fields = null; //Optional 
$smsTemplate = "smsTemplate"; //Optional

$result = $multiFactorAuthenticationAPI->mfaUpdateByAccessToken($access_token,$payload,$fields,$smsTemplate);
MFA Update Phone Number by Token (PUT)

This API is used to update the Multi-factor authentication phone number by sending the verification OTP to the provided phone number More Info

$access_token = "access_token"; //Required 
$phoneNo2FA = "phoneNo2FA"; //Required 
$smsTemplate2FA = "smsTemplate2FA"; //Optional

$result = $multiFactorAuthenticationAPI->mfaUpdatePhoneNumberByToken($access_token,$phoneNo2FA,$smsTemplate2FA);
Verify MFA Email OTP by Access Token (PUT)

This API is used to set up MFA Email OTP authenticator on profile after login. More Info

$access_token = "access_token"; //Required
$payload = '{ 
  "EmailId":"",
  "Otp":"otp"
 }';  //Required

$result = $multiFactorAuthenticationAPI->mfaValidateEmailOtpByAccessToken($access_token,$payload);
Update MFA Security Question by Access Token (PUT)

This API is used to set up MFA Security Question authenticator on profile after login. More Info

$access_token = "access_token"; //Required
$payload = '{
   "securityquestionanswer": [
       {
           "QuestionId": "db7****8a73e4******bd9****8c20",
           "Answer": "<answer>"
       }
   ],
    "ReplaceSecurityQuestionAnswer":false // required
 }';  //Required

$result = $multiFactorAuthenticationAPI->mfaSecurityQuestionAnswerByAccessToken($access_token,$payload);
MFA Validate OTP (PUT)

This API is used to login via Multi-factor authentication by passing the One Time Password received via SMS More Info

$payload = '{
"otp" : "<otp>"
}';  //Required 
$secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required 
$fields = null; //Optional 
$smsTemplate2FA = "smsTemplate2FA"; //Optional
$rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional 
$rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional 
$rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional 
$rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional 

$result = $multiFactorAuthenticationAPI->mfaValidateOTPByPhone($payload,$secondFactorAuthenticationToken,$fields,$smsTemplate2FA,$rbaBrowserEmailTemplate,$rbaCityEmailTemplate,$rbaCountryEmailTemplate,$rbaIpEmailTemplate);
MFA Validate Google Auth Code (PUT)

This API is used to login via Multi-factor-authentication by passing the google authenticator code. More Info

$googleAuthenticatorCode = "googleAuthenticatorCode"; //Required 
$secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required 
$fields = null; //Optional 
$rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional 
$rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional 
$rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional 
$rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional

$result = $multiFactorAuthenticationAPI->mfaValidateGoogleAuthCode($googleAuthenticatorCode,$secondFactorAuthenticationToken,$fields,$rbaBrowserEmailTemplate,$rbaCityEmailTemplate,$rbaCountryEmailTemplate,$rbaIpEmailTemplate);
MFA Validate Backup code (PUT)

This API is used to validate the backup code provided by the user and if valid, we return an access token allowing the user to login incases where Multi-factor authentication (MFA) is enabled and the secondary factor is unavailable. When a user initially downloads the Backup codes, We generate 10 codes, each code can only be consumed once. if any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically More Info

$payload = '{
"backupCode" : "<backupCode>"
}';  //Required 
$secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required 
$fields = null; //Optional 
$rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional 
$rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional 
$rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional 
$rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional

$result = $multiFactorAuthenticationAPI->mfaValidateBackupCode($payload,$secondFactorAuthenticationToken,$fields,$rbaBrowserEmailTemplate,$rbaCityEmailTemplate,$rbaCountryEmailTemplate,$rbaIpEmailTemplate);
MFA Update Phone Number (PUT)

This API is used to update (if configured) the phone number used for Multi-factor authentication by sending the verification OTP to the provided phone number More Info

$phoneNo2FA = "phoneNo2FA"; //Required 
$secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required 
$smsTemplate2FA = "smsTemplate2FA"; //Optional

$result = $multiFactorAuthenticationAPI->mfaUpdatePhoneNumber($phoneNo2FA,$secondFactorAuthenticationToken,$smsTemplate2FA);
Verify MFA Email OTP by MFA Token (PUT)

This API is used to Verify MFA Email OTP by MFA Token More Info

$payload = '
   {
       "EmailId":"email",
       "Otp":"otp"
   }';  //Required 
$secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required 
$rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional 
$rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional 
$rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional 
$rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional

$result = $multiFactorAuthenticationAPI->mfaValidateEmailOtp($payload,$secondFactorAuthenticationToken,$rbaBrowserEmailTemplate,$rbaCityEmailTemplate,$rbaCountryEmailTemplate,$rbaIpEmailTemplate);
Update MFA Security Question by MFA Token (PUT)

This API is used to set the security questions on the profile with the MFA token when MFA flow is required. More Info

$payload = '{
   "securityquestionanswer": [
       {
           "QuestionId": "db7****8a73e4******bd9****8c20",
           "Answer": "<answer>"
       }
   ]
}';  //Required 
$secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required

$result = $multiFactorAuthenticationAPI->mfaSecurityQuestionAnswer($payload,$secondFactorAuthenticationToken);
MFA Email Login (POST)

This API can be used to login by emailid on a Multi-factor authentication enabled LoginRadius site. More Info

$email = "email"; //Required 
$password = "password"; //Required 
$emailTemplate = "emailTemplate"; //Optional 
$fields = null; //Optional 
$loginUrl = "loginUrl"; //Optional 
$smsTemplate = "smsTemplate"; //Optional 
$smsTemplate2FA = "smsTemplate2FA"; //Optional 
$verificationUrl = "verificationUrl"; //Optional
$emailTemplate2FA = "emailTemplate2FA"; //Optional 

$result = $multiFactorAuthenticationAPI->mfaLoginByEmail($email,$password,$emailTemplate,$fields,$loginUrl,$smsTemplate,$smsTemplate2FA,$verificationUrl,$emailTemplate2FA);
MFA UserName Login (POST)

This API can be used to login by username on a Multi-factor authentication enabled LoginRadius site. More Info

$password = "password"; //Required 
$username = "username"; //Required 
$emailTemplate = "emailTemplate"; //Optional 
$fields = null; //Optional 
$loginUrl = "loginUrl"; //Optional 
$smsTemplate = "smsTemplate"; //Optional 
$smsTemplate2FA = "smsTemplate2FA"; //Optional 
$verificationUrl = "verificationUrl"; //Optional
$emailTemplate2FA = "emailTemplate2FA"; //Optional 

$result = $multiFactorAuthenticationAPI->mfaLoginByUserName($password,$username,$emailTemplate,$fields,$loginUrl,$smsTemplate,$smsTemplate2FA,$verificationUrl,$emailTemplate2FA);
MFA Phone Login (POST)

This API can be used to login by Phone on a Multi-factor authentication enabled LoginRadius site. More Info

$password = "password"; //Required 
$phone = "phone"; //Required 
$emailTemplate = "emailTemplate"; //Optional 
$fields = null; //Optional 
$loginUrl = "loginUrl"; //Optional 
$smsTemplate = "smsTemplate"; //Optional 
$smsTemplate2FA = "smsTemplate2FA"; //Optional 
$verificationUrl = "verificationUrl"; //Optional
$emailTemplate2FA = "emailTemplate2FA"; //Optional 

$result = $multiFactorAuthenticationAPI->mfaLoginByPhone($password,$phone,$emailTemplate,$fields,$loginUrl,$smsTemplate,$smsTemplate2FA,$verificationUrl,$emailTemplate2FA);
Send MFA Email OTP by MFA Token (POST)

An API designed to send the MFA Email OTP to the email. More Info

$payload = '{ 
   "EmailId":"email"
 }';  //Required 
$secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required 
$emailTemplate2FA = "emailTemplate2FA"; //Optional

$result = $multiFactorAuthenticationAPI->mfaEmailOTP($payload,$secondFactorAuthenticationToken,$emailTemplate2FA);
Verify MFA Security Question by MFA Token (POST)

This API is used to resending the verification OTP to the provided phone number More Info

$payload = '{
   "securityquestionanswer": [
       {
           "QuestionId": "db7****8a73e4******bd9****8c20",
           "Answer": "<answer>"
       }
   ]
}';  //Required 
$secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required 
$rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional 
$rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional 
$rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional 
$rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional

$result = $multiFactorAuthenticationAPI->mfaSecurityQuestionAnswerVerification($payload,$secondFactorAuthenticationToken,$rbaBrowserEmailTemplate,$rbaCityEmailTemplate,$rbaCountryEmailTemplate,$rbaIpEmailTemplate);
MFA Validate Access Token (GET)

This API is used to configure the Multi-factor authentication after login by using the access token when MFA is set as optional on the LoginRadius site. More Info

$access_token = "access_token"; //Required 
$smsTemplate2FA = "smsTemplate2FA"; //Optional

$result = $multiFactorAuthenticationAPI->mfaConfigureByAccessToken($access_token,$smsTemplate2FA);
MFA Backup Code by Access Token (GET)

This API is used to get a set of backup codes via access token to allow the user login on a site that has Multi-factor Authentication enabled in the event that the user does not have a secondary factor available. We generate 10 codes, each code can only be consumed once. If any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically More Info

$access_token = "access_token"; //Required

$result = $multiFactorAuthenticationAPI->mfaBackupCodeByAccessToken($access_token);
Reset Backup Code by Access Token (GET)

API is used to reset the backup codes on a given account via the access token. This API call will generate 10 new codes, each code can only be consumed once More Info

$access_token = "access_token"; //Required

$result = $multiFactorAuthenticationAPI->mfaResetBackupCodeByAccessToken($access_token);
Send MFA Email OTP by Access Token (GET)

This API is created to send the OTP to the email if email OTP authenticator is enabled in app's MFA configuration. More Info

$access_token = "access_token"; //Required 
$emailId = "emailId"; //Required 
$emailTemplate2FA = "emailTemplate2FA"; //Optional

$result = $multiFactorAuthenticationAPI->mfaEmailOtpByAccessToken($access_token,$emailId,$emailTemplate2FA);
MFA Resend Otp (GET)

This API is used to resending the verification OTP to the provided phone number More Info

$secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required 
$smsTemplate2FA = "smsTemplate2FA"; //Optional

$result = $multiFactorAuthenticationAPI->mfaResendOTP($secondFactorAuthenticationToken,$smsTemplate2FA);
MFA Backup Code by UID (GET)

This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once. More Info

$uid = "uid"; //Required

$result = $multiFactorAuthenticationAPI->mfaBackupCodeByUid($uid);
MFA Reset Backup Code by UID (GET)

This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once. More Info

$uid = "uid"; //Required

$result = $multiFactorAuthenticationAPI->mfaResetBackupCodeByUid($uid);
MFA Reset Google Authenticator by Token (DELETE)

This API Resets the Google Authenticator configurations on a given account via the access token More Info

$access_token = "access_token"; //Required 
$googleauthenticator = "true"; //Required

$result = $multiFactorAuthenticationAPI->mfaResetGoogleAuthByToken($access_token,$googleauthenticator);
MFA Reset SMS Authenticator by Token (DELETE)

This API resets the SMS Authenticator configurations on a given account via the access token. More Info

$access_token = "access_token"; //Required 
$otpauthenticator = "true"; //Required

$result = $multiFactorAuthenticationAPI->mfaResetSMSAuthByToken($access_token,$otpauthenticator);
Reset MFA Email OTP Authenticator By Access Token (DELETE)

This API is used to reset the Email OTP Authenticator settings for an MFA-enabled user More Info

$access_token = "access_token"; //Required

$result = $multiFactorAuthenticationAPI->mfaResetEmailOtpAuthenticatorByAccessToken($access_token);
MFA Reset Security Question Authenticator By Access Token (DELETE)

This API is used to Reset MFA Security Question Authenticator By Access Token More Info

$access_token = "access_token"; //Required

$result = $multiFactorAuthenticationAPI->mfaResetSecurityQuestionAuthenticatorByAccessToken($access_token);
MFA Reset SMS Authenticator By UID (DELETE)

This API resets the SMS Authenticator configurations on a given account via the UID. More Info

$otpauthenticator = "true"; //Required 
$uid = "uid"; //Required

$result = $multiFactorAuthenticationAPI->mfaResetSMSAuthenticatorByUid($otpauthenticator,$uid);
MFA Reset Google Authenticator By UID (DELETE)

This API resets the Google Authenticator configurations on a given account via the UID. More Info

$googleauthenticator = "true"; //Required 
$uid = "uid"; //Required

$result = $multiFactorAuthenticationAPI->mfaResetGoogleAuthenticatorByUid($googleauthenticator,$uid);
Reset MFA Email OTP Authenticator Settings by Uid (DELETE)

This API is used to reset the Email OTP Authenticator settings for an MFA-enabled user. More Info

$uid = "uid"; //Required

$result = $multiFactorAuthenticationAPI->mfaResetEmailOtpAuthenticatorByUid($uid);
Reset MFA Security Question Authenticator Settings by Uid (DELETE)

This API is used to reset the Security Question Authenticator settings for an MFA-enabled user. More Info

$uid = "uid"; //Required

$result = $multiFactorAuthenticationAPI->mfaResetSecurityQuestionAuthenticatorByUid($uid);

PINAuthentication API

List of APIs in this Section:
PUT : Reset PIN By ResetToken
PUT : Reset PIN By SecurityAnswer And Email
PUT : Reset PIN By SecurityAnswer And Username
PUT : Reset PIN By SecurityAnswer And Phone
PUT : Change PIN By Token
PUT : Reset PIN by Phone and OTP
PUT : Reset PIN by Email and OTP
PUT : Reset PIN by Username and OTP
POST : PIN Login
POST : Forgot PIN By Email
POST : Forgot PIN By UserName
POST : Forgot PIN By Phone
POST : Set PIN By PinAuthToken
GET : Invalidate PIN Session Token

If you have not already initialized the PINAuthentication object do so now

$pinAuthenticationAPI = new PINAuthenticationAPI(); 
Reset PIN By ResetToken (PUT)

This API is used to reset pin using reset token. More Info

$payload = '{
"pin" : "<pin>",
"resetToken" : "<resetToken>"
}';  //Required

$result = $pinAuthenticationAPI->resetPINByResetToken($payload);
Reset PIN By SecurityAnswer And Email (PUT)

This API is used to reset pin using security question answer and email. More Info

$payload = '{
"email" : "<email>",
"pin" : "<pin>",
"securityAnswer" : {"QuestionID":"Answer"}
}';  //Required

$result = $pinAuthenticationAPI->resetPINByEmailAndSecurityAnswer($payload);
Reset PIN By SecurityAnswer And Username (PUT)

This API is used to reset pin using security question answer and username. More Info

$payload = '{
"pin" : "<pin>",
"securityAnswer" : {"QuestionID":"Answer"},
"username" : "<username>"
}';  //Required

$result = $pinAuthenticationAPI->resetPINByUsernameAndSecurityAnswer($payload);
Reset PIN By SecurityAnswer And Phone (PUT)

This API is used to reset pin using security question answer and phone. More Info

$payload = '{
"phone" : "<phone>",
"pin" : "<pin>",
"securityAnswer" : {"QuestionID":"Answer"}
}';  //Required

$result = $pinAuthenticationAPI->resetPINByPhoneAndSecurityAnswer($payload);
Change PIN By Token (PUT)

This API is used to change a user's PIN using access token. More Info

$access_token = "access_token"; //Required
$payload = '{
"newPIN" : "<newPIN>",
"oldPIN" : "<oldPIN>"
}';  //Required

$result = $pinAuthenticationAPI->changePINByAccessToken($access_token,$payload);
Reset PIN by Phone and OTP (PUT)

This API is used to reset pin using phoneId and OTP. More Info

$payload = '{
"otp" : "<otp>",
"phone" : "<phone>",
"pin" : "<pin>"
}';  //Required

$result = $pinAuthenticationAPI->resetPINByPhoneAndOtp($payload);
Reset PIN by Email and OTP (PUT)

This API is used to reset pin using email and OTP. More Info

$payload = '{
"email" : "<email>",
"otp" : "<otp>",
"pin" : "<pin>"
}';  //Required

$result = $pinAuthenticationAPI->resetPINByEmailAndOtp($payload);
Reset PIN by Username and OTP (PUT)

This API is used to reset pin using username and OTP. More Info

$payload = '{
"otp" : "<otp>",
"pin" : "<pin>",
"username" : "<username>"
}';  //Required

$result = $pinAuthenticationAPI->resetPINByUsernameAndOtp($payload);
PIN Login (POST)

This API is used to login a user by pin and session token. More Info

$payload = '{
"pin" : "<pin>"
}';  //Required 
$session_token = "session_token"; //Required

$result = $pinAuthenticationAPI->pinLogin($payload,$session_token);
Forgot PIN By Email (POST)

This API sends the reset pin email to specified email address. More Info

$payload = '{
"email" : "<email>"
}';  //Required 
$emailTemplate = "emailTemplate"; //Optional 
$resetPINUrl = "resetPINUrl"; //Optional

$result = $pinAuthenticationAPI->sendForgotPINEmailByEmail($payload,$emailTemplate,$resetPINUrl);
Forgot PIN By UserName (POST)

This API sends the reset pin email using username. More Info

$payload = '{
"userName" : "<userName>"
}';  //Required 
$emailTemplate = "emailTemplate"; //Optional 
$resetPINUrl = "resetPINUrl"; //Optional

$result = $pinAuthenticationAPI->sendForgotPINEmailByUsername($payload,$emailTemplate,$resetPINUrl);
Forgot PIN By Phone (POST)

This API sends the OTP to specified phone number More Info

$payload = '{
"phone" : "<phone>"
}';  //Required 
$smsTemplate = "smsTemplate"; //Optional

$result = $pinAuthenticationAPI->sendForgotPINSMSByPhone($payload,$smsTemplate);
Set PIN By PinAuthToken (POST)

This API is used to change a user's PIN using Pin Auth token. More Info

$payload = '{
"pin" : "<pin>"
}';  //Required 
$pinAuthToken = "pinAuthToken"; //Required

$result = $pinAuthenticationAPI->setPINByPinAuthToken($payload,$pinAuthToken);
Invalidate PIN Session Token (GET)

This API is used to invalidate pin session token. More Info

$session_token = "session_token"; //Required

$result = $pinAuthenticationAPI->inValidatePinSessionToken($session_token);

ReAuthentication API

List of APIs in this Section:
PUT : Validate MFA by OTP
PUT : Validate MFA by Backup Code
PUT : Validate MFA by Google Authenticator Code
PUT : Validate MFA by Password
PUT : MFA Re-authentication by PIN
PUT : MFA Re-authentication by Email OTP
POST : Verify Multifactor OTP Authentication
POST : Verify Multifactor Password Authentication
POST : Verify Multifactor PIN Authentication
POST : MFA Re-authentication by Security Question
GET : Multi Factor Re-Authenticate
GET : Send MFA Re-auth Email OTP by Access Token

If you have not already initialized the ReAuthentication object do so now

$reAuthenticationAPI = new ReAuthenticationAPI(); 
Validate MFA by OTP (PUT)

This API is used to re-authenticate via Multi-factor authentication by passing the One Time Password received via SMS More Info

$access_token = "access_token"; //Required
$payload = '{
"otp" : "<otp>"
}';  //Required

$result = $reAuthenticationAPI->mfaReAuthenticateByOTP($access_token,$payload);
Validate MFA by Backup Code (PUT)

This API is used to re-authenticate by set of backup codes via access token on the site that has Multi-factor authentication enabled in re-authentication for the user that does not have the device More Info

$access_token = "access_token"; //Required
$payload = '{
"backupCode" : "<backupCode>"
}';  //Required

$result = $reAuthenticationAPI->mfaReAuthenticateByBackupCode($access_token,$payload);
Validate MFA by Google Authenticator Code (PUT)

This API is used to re-authenticate via Multi-factor-authentication by passing the google authenticator code More Info

$access_token = "access_token"; //Required
$payload = '{
"googleAuthenticatorCode" : "<googleAuthenticatorCode>"
}';  //Required

$result = $reAuthenticationAPI->mfaReAuthenticateByGoogleAuth($access_token,$payload);
Validate MFA by Password (PUT)

This API is used to re-authenticate via Multi-factor-authentication by passing the password More Info

$access_token = "access_token"; //Required
$payload = '{
"password" : "<password>"
}';  //Required 
$smsTemplate2FA = "smsTemplate2FA"; //Optional

$result = $reAuthenticationAPI->mfaReAuthenticateByPassword($access_token,$payload,$smsTemplate2FA);
MFA Re-authentication by PIN (PUT)

This API is used to validate the triggered MFA authentication flow with a password. More Info

$access_token = "access_token"; //Required
$payload = '{
"pin" : "<pin>"
}';  //Required 
$smsTemplate2FA = "smsTemplate2FA"; //Optional

$result = $reAuthenticationAPI->verifyPINAuthentication($access_token,$payload,$smsTemplate2FA);
MFA Re-authentication by Email OTP (PUT)

This API is used to validate the triggered MFA authentication flow with an Email OTP. More Info

$access_token = "access_token"; //Required
$payload = '{
 "EmailId":"email",
 "otp": "otp"
}';  //Required

$result = $reAuthenticationAPI->reAuthValidateEmailOtp($access_token,$payload);
Verify Multifactor OTP Authentication (POST)

This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by OTP. More Info

$payload = '{
"secondFactorValidationToken" : "<secondFactorValidationToken>"
}';  //Required 
$uid = "uid"; //Required

$result = $reAuthenticationAPI->verifyMultiFactorOtpReauthentication($payload,$uid);
Verify Multifactor Password Authentication (POST)

This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by password. More Info

$payload = '{
"secondFactorValidationToken" : "<secondFactorValidationToken>"
}';  //Required 
$uid = "uid"; //Required

$result = $reAuthenticationAPI->verifyMultiFactorPasswordReauthentication($payload,$uid);
Verify Multifactor PIN Authentication (POST)

This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by PIN. More Info

$payload = '{
"secondFactorValidationToken" : "<secondFactorValidationToken>"
}';  //Required 
$uid = "uid"; //Required

$result = $reAuthenticationAPI->verifyMultiFactorPINReauthentication($payload,$uid);
MFA Re-authentication by Security Question (POST)

This API is used to validate the triggered MFA re-authentication flow with security questions answers. More Info

$access_token = "access_token"; //Required
$payload = '{
   "securityquestionanswer": [
       {
           "QuestionId": "db7****8a73e4******bd9****8c20",
           "Answer": "<answer>"
       }
   ]
}';  //Required

$result = $reAuthenticationAPI->reAuthBySecurityQuestion($access_token,$payload);
Multi Factor Re-Authenticate (GET)

This API is used to trigger the Multi-Factor Autentication workflow for the provided access token More Info

$access_token = "access_token"; //Required 
$smsTemplate2FA = "smsTemplate2FA"; //Optional

$result = $reAuthenticationAPI->mfaReAuthenticate($access_token,$smsTemplate2FA);
Send MFA Re-auth Email OTP by Access Token (GET)

This API is used to send the MFA Email OTP to the email for Re-authentication More Info

$access_token = "access_token"; //Required 
$emailId = "emailId"; //Required 
$emailTemplate2FA = "emailTemplate2FA"; //Optional

$result = $reAuthenticationAPI->reAuthSendEmailOtp($access_token,$emailId,$emailTemplate2FA);

ConsentManagement API

List of APIs in this Section:
PUT : Update Consent By Access Token
POST : Consent By ConsentToken
POST : Post Consent By Access Token
GET : Get Consent Logs By Uid
GET : Get Consent Log by Access Token
GET : Get Verify Consent By Access Token

If you have not already initialized the ConsentManagement object do so now

$consentManagementAPI = new ConsentManagementAPI(); 
Update Consent By Access Token (PUT)

This API is to update consents using access token. More Info

$access_token = "access_token"; //Required
$payload = '{
"consents" : [   { 
"consentOptionId" : "<consentOptionId>"  ,
"isAccepted" : true  
}  ] 
}';  //Required

$result = $consentManagementAPI->updateConsentProfileByAccessToken($access_token,$payload);
Consent By ConsentToken (POST)

This API is to submit consent form using consent token. More Info

$consentToken = "consentToken"; //Required
$payload = '{
"data" : [   { 
"consentOptionId" : "<consentOptionId>"  ,
"isAccepted" : true  
}  ] ,
"events" : [   { 
"event" : "<event>"  ,
"isCustom" : true  
}  ] 
}';  //Required

$result = $consentManagementAPI->submitConsentByConsentToken($consentToken,$payload);
Post Consent By Access Token (POST)

API to provide a way to end user to submit a consent form for particular event type. More Info

$access_token = "access_token"; //Required
$payload = '{
"data" : [   { 
"consentOptionId" : "<consentOptionId>"  ,
"isAccepted" : true  
}  ] ,
"events" : [   { 
"event" : "<event>"  ,
"isCustom" : true  
}  ] 
}';  //Required

$result = $consentManagementAPI->submitConsentByAccessToken($access_token,$payload);
Get Consent Logs By Uid (GET)

This API is used to get the Consent logs of the user. More Info

$uid = "uid"; //Required

$result = $consentManagementAPI->getConsentLogsByUid($uid);
Get Consent Log by Access Token (GET)

This API is used to fetch consent logs. More Info

$access_token = "access_token"; //Required

$result = $consentManagementAPI->getConsentLogs($access_token);
Get Verify Consent By Access Token (GET)

This API is used to check if consent is submitted for a particular event or not. More Info

$access_token = "access_token"; //Required 
$event = "event"; //Required 
$isCustom = "true"; //Required

$result = $consentManagementAPI->verifyConsentByAccessToken($access_token,$event,$isCustom);

SmartLogin API

List of APIs in this Section:
GET : Smart Login Verify Token
GET : Smart Login By Email
GET : Smart Login By Username
GET : Smart Login Ping

If you have not already initialized the SmartLogin object do so now

$smartLoginAPI = new SmartLoginAPI(); 
Smart Login Verify Token (GET)

This API verifies the provided token for Smart Login More Info

$verificationToken = "verificationToken"; //Required 
$welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional

$result = $smartLoginAPI->smartLoginTokenVerification($verificationToken,$welcomeEmailTemplate);
Smart Login By Email (GET)

This API sends a Smart Login link to the user's Email Id. More Info

$clientGuid = "clientGuid"; //Required 
$email = "email"; //Required 
$redirectUrl = "redirectUrl"; //Optional 
$smartLoginEmailTemplate = "smartLoginEmailTemplate"; //Optional 
$welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional

$result = $smartLoginAPI->smartLoginByEmail($clientGuid,$email,$redirectUrl,$smartLoginEmailTemplate,$welcomeEmailTemplate);
Smart Login By Username (GET)

This API sends a Smart Login link to the user's Email Id. More Info

$clientGuid = "clientGuid"; //Required 
$username = "username"; //Required 
$redirectUrl = "redirectUrl"; //Optional 
$smartLoginEmailTemplate = "smartLoginEmailTemplate"; //Optional 
$welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional

$result = $smartLoginAPI->smartLoginByUserName($clientGuid,$username,$redirectUrl,$smartLoginEmailTemplate,$welcomeEmailTemplate);
Smart Login Ping (GET)

This API is used to check if the Smart Login link has been clicked or not More Info

$clientGuid = "clientGuid"; //Required 
$fields = null; //Optional

$result = $smartLoginAPI->smartLoginPing($clientGuid,$fields);

OneTouchLogin API

List of APIs in this Section:
PUT : One Touch OTP Verification
POST : One Touch Login by Email
POST : One Touch Login by Phone
GET : One Touch Email Verification
GET : One Touch Login Ping

If you have not already initialized the OneTouchLogin object do so now

$oneTouchLoginAPI = new OneTouchLoginAPI(); 
One Touch OTP Verification (PUT)

This API is used to verify the otp for One Touch Login. More Info

$otp = "otp"; //Required 
$phone = "phone"; //Required 
$fields = null; //Optional 
$smsTemplate = "smsTemplate"; //Optional

$result = $oneTouchLoginAPI->oneTouchLoginOTPVerification($otp,$phone,$fields,$smsTemplate);
One Touch Login by Email (POST)

This API is used to send a link to a specified email for a frictionless login/registration More Info

$payload = '{
"clientguid" : "<clientguid>",
"email" : "<email>",
"g-recaptcha-response" : "<g-recaptcha-response>"
}';  //Required 
$oneTouchLoginEmailTemplate = "oneTouchLoginEmailTemplate"; //Optional 
$redirecturl = "redirecturl"; //Optional 
$welcomeemailtemplate = "welcomeemailtemplate"; //Optional

$result = $oneTouchLoginAPI->oneTouchLoginByEmail($payload,$oneTouchLoginEmailTemplate,$redirecturl,$welcomeemailtemplate);
One Touch Login by Phone (POST)

This API is used to send one time password to a given phone number for a frictionless login/registration. More Info

$payload = '{
"g-recaptcha-response" : "<g-recaptcha-response>",
"phone" : "<phone>"
}';  //Required 
$smsTemplate = "smsTemplate"; //Optional

$result = $oneTouchLoginAPI->oneTouchLoginByPhone($payload,$smsTemplate);
One Touch Email Verification (GET)

This API verifies the provided token for One Touch Login More Info

$verificationToken = "verificationToken"; //Required 
$welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional

$result = $oneTouchLoginAPI->oneTouchEmailVerification($verificationToken,$welcomeEmailTemplate);
One Touch Login Ping (GET)

This API is used to check if the One Touch Login link has been clicked or not. More Info

$clientGuid = "clientGuid"; //Required 
$fields = null; //Optional

$result = $oneTouchLoginAPI->oneTouchLoginPing($clientGuid,$fields);

PasswordLessLogin API

List of APIs in this Section:
PUT : Passwordless Login Phone Verification
POST : Passwordless Login Verification By Email And OTP
POST : Passwordless Login Verification By User Name And OTP
GET : Passwordless Login by Phone
GET : Passwordless Login By Email
GET : Passwordless Login By UserName
GET : Passwordless Login Verification

If you have not already initialized the PasswordLessLogin object do so now

$passwordLessLoginAPI = new PasswordLessLoginAPI(); 
Passwordless Login Phone Verification (PUT)

This API verifies an account by OTP and allows the customer to login. More Info

$payload = '{
"otp" : "<otp>",
"phone" : "<phone>"
}';  //Required 
$fields = null; //Optional 
$smsTemplate = "smsTemplate"; //Optional

$result = $passwordLessLoginAPI->passwordlessLoginPhoneVerification($payload,$fields,$smsTemplate);
Passwordless Login Verification By Email And OTP (POST)

This API is used to verify the otp sent to the email when doing a passwordless login. More Info

$payload = '{ 
"email": "<email>",
"otp": "<otp>",
"welcomeemailtemplate": "<welcome_email_template>"

 }';  //Required 
$fields = null; //Optional

$result = $passwordLessLoginAPI->passwordlessLoginVerificationByEmailAndOTP($payload,$fields);
Passwordless Login Verification By User Name And OTP (POST)

This API is used to verify the otp sent to the email when doing a passwordless login. More Info

$payload = '{ 
"username": "<User name>",
"otp": "<otp>",
"welcomeemailtemplate": "<welcome_email_template>"

 }';  //Required 
$fields = null; //Optional

$result = $passwordLessLoginAPI->passwordlessLoginVerificationByUserNameAndOTP($payload,$fields);
Passwordless Login by Phone (GET)

API can be used to send a One-time Passcode (OTP) provided that the account has a verified PhoneID More Info

$phone = "phone"; //Required 
$smsTemplate = "smsTemplate"; //Optional

$result = $passwordLessLoginAPI->passwordlessLoginByPhone($phone,$smsTemplate);
Passwordless Login By Email (GET)

This API is used to send a Passwordless Login verification link to the provided Email ID More Info

$email = "email"; //Required 
$passwordLessLoginTemplate = "passwordLessLoginTemplate"; //Optional 
$verificationUrl = "verificationUrl"; //Optional

$result = $passwordLessLoginAPI->passwordlessLoginByEmail($email,$passwordLessLoginTemplate,$verificationUrl);
Passwordless Login By UserName (GET)

This API is used to send a Passwordless Login Verification Link to a customer by providing their UserName More Info

$username = "username"; //Required 
$passwordLessLoginTemplate = "passwordLessLoginTemplate"; //Optional 
$verificationUrl = "verificationUrl"; //Optional

$result = $passwordLessLoginAPI->passwordlessLoginByUserName($username,$passwordLessLoginTemplate,$verificationUrl);
Passwordless Login Verification (GET)

This API is used to verify the Passwordless Login verification link. Note: If you are using Passwordless Login by Phone you will need to use the Passwordless Login Phone Verification API More Info

$verificationToken = "verificationToken"; //Required 
$fields = null; //Optional 
$welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional

$result = $passwordLessLoginAPI->passwordlessLoginVerification($verificationToken,$fields,$welcomeEmailTemplate);

Configuration API

List of APIs in this Section:
GET : Get Configurations
GET : Get Server Time

If you have not already initialized the Configuration object do so now

$configurationAPI = new ConfigurationAPI(); 
Get Configurations (GET)

This API is used to get the configurations which are set in the LoginRadius Dashboard for a particular LoginRadius site/environment More Info

$result = $configurationAPI->getConfigurations();
Get Server Time (GET)

This API allows you to query your LoginRadius account for basic server information and server time information which is useful when generating an SOTT token. More Info

$timeDifference = 0; //Optional

$result = $configurationAPI->getServerInfo($timeDifference);

Role API

List of APIs in this Section:
PUT : Assign Roles by UID
PUT : Upsert Context
PUT : Add Permissions to Role
POST : Roles Create
GET : Roles by UID
GET : Get Context with Roles and Permissions
GET : Role Context profile
GET : Roles List
DELETE : Unassign Roles by UID
DELETE : Delete Role Context
DELETE : Delete Role from Context
DELETE : Delete Additional Permission from Context
DELETE : Account Delete Role
DELETE : Remove Permissions

If you have not already initialized the Role object do so now

$roleAPI = new RoleAPI(); 
Assign Roles by UID (PUT)

This API is used to assign your desired roles to a given user. More Info

$payload = '{
"roles" : [  "roles" ] 
}';  //Required 
$uid = "uid"; //Required

$result = $roleAPI->assignRolesByUid($payload,$uid);
Upsert Context (PUT)

This API creates a Context with a set of Roles More Info

$payload = '{
"roleContext" : [   { 
 "additionalPermissions" : ["<additionalPermissions>" ] ,
"context" : "<context>"  ,
"expiration" : "<expiration>"  ,
 "roles" : ["<roles>" ]  
}  ] 
}';  //Required 
$uid = "uid"; //Required

$result = $roleAPI->updateRoleContextByUid($payload,$uid);
Add Permissions to Role (PUT)

This API is used to add permissions to a given role. More Info

$payload = '{
"permissions" : [  "permissions" ] 
}';  //Required 
$role = "role"; //Required

$result = $roleAPI->addRolePermissions($payload,$role);
Roles Create (POST)

This API creates a role with permissions. More Info

$payload = '{
"roles" : [   { 
"name" : "<name>"  ,
"permissions" : {"Permission_name":true}  
}  ] 
}';  //Required

$result = $roleAPI->createRoles($payload);
Roles by UID (GET)

API is used to retrieve all the assigned roles of a particular User. More Info

$uid = "uid"; //Required

$result = $roleAPI->getRolesByUid($uid);
Get Context with Roles and Permissions (GET)

This API Gets the contexts that have been configured and the associated roles and permissions. More Info

$uid = "uid"; //Required

$result = $roleAPI->getRoleContextByUid($uid);
Role Context profile (GET)

The API is used to retrieve role context by the context name. More Info

$contextName = "contextName"; //Required

$result = $roleAPI->getRoleContextByContextName($contextName);
Roles List (GET)

This API retrieves the complete list of created roles with permissions of your app. More Info

$result = $roleAPI->getRolesList();
Unassign Roles by UID (DELETE)

This API is used to unassign roles from a user. More Info

$payload = '{
"roles" : [  "roles" ] 
}';  //Required 
$uid = "uid"; //Required

$result = $roleAPI->unassignRolesByUid($payload,$uid);
Delete Role Context (DELETE)

This API Deletes the specified Role Context More Info

$contextName = "contextName"; //Required 
$uid = "uid"; //Required

$result = $roleAPI->deleteRoleContextByUid($contextName,$uid);
Delete Role from Context (DELETE)

This API Deletes the specified Role from a Context. More Info

$contextName = "contextName"; //Required
$payload = '{
"roles" : [  "roles" ] 
}';  //Required 
$uid = "uid"; //Required

$result = $roleAPI->deleteRolesFromRoleContextByUid($contextName,$payload,$uid);
Delete Additional Permission from Context (DELETE)

This API Deletes Additional Permissions from Context. More Info

$contextName = "contextName"; //Required
$payload = '{
"additionalPermissions" : [  "additionalPermissions" ] 
}';  //Required 
$uid = "uid"; //Required

$result = $roleAPI->deleteAdditionalPermissionFromRoleContextByUid($contextName,$payload,$uid);
Account Delete Role (DELETE)

This API is used to delete the role. More Info

$role = "role"; //Required

$result = $roleAPI->deleteRole($role);
Remove Permissions (DELETE)

API is used to remove permissions from a role. More Info

$payload = '{
"permissions" : [  "permissions" ] 
}';  //Required 
$role = "role"; //Required

$result = $roleAPI->removeRolePermissions($payload,$role);

RiskBasedAuthentication API

List of APIs in this Section:
POST : Risk Based Authentication Login by Email
POST : Risk Based Authentication Login by Username
POST : Risk Based Authentication Phone Login

If you have not already initialized the RiskBasedAuthentication object do so now

$riskBasedAuthenticationAPI = new RiskBasedAuthenticationAPI(); 
Risk Based Authentication Login by Email (POST)

This API retrieves a copy of the user data based on the Email More Info

$payload = '{
"email" : "<email>",
"password" : "<password>"
}';  //Required 
$emailTemplate = "emailTemplate"; //Optional 
$fields = null; //Optional 
$loginUrl = "loginUrl"; //Optional 
$passwordDelegation = "true"; //Optional 
$passwordDelegationApp = "passwordDelegationApp"; //Optional 
$rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional 
$rbaBrowserSmsTemplate = "rbaBrowserSmsTemplate"; //Optional 
$rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional 
$rbaCitySmsTemplate = "rbaCitySmsTemplate"; //Optional 
$rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional 
$rbaCountrySmsTemplate = "rbaCountrySmsTemplate"; //Optional 
$rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional 
$rbaIpSmsTemplate = "rbaIpSmsTemplate"; //Optional 
$rbaOneclickEmailTemplate = "rbaOneclickEmailTemplate"; //Optional 
$rbaOTPSmsTemplate = "rbaOTPSmsTemplate"; //Optional 
$smsTemplate = "smsTemplate"; //Optional 
$verificationUrl = "verificationUrl"; //Optional

$result = $riskBasedAuthenticationAPI->rbaLoginByEmail($payload,$emailTemplate,$fields,$loginUrl,$passwordDelegation,$passwordDelegationApp,$rbaBrowserEmailTemplate,$rbaBrowserSmsTemplate,$rbaCityEmailTemplate,$rbaCitySmsTemplate,$rbaCountryEmailTemplate,$rbaCountrySmsTemplate,$rbaIpEmailTemplate,$rbaIpSmsTemplate,$rbaOneclickEmailTemplate,$rbaOTPSmsTemplate,$smsTemplate,$verificationUrl);
Risk Based Authentication Login by Username (POST)

This API retrieves a copy of the user data based on the Username More Info

$payload = '{
"password" : "<password>",
"username" : "<username>"
}';  //Required 
$emailTemplate = "emailTemplate"; //Optional 
$fields = null; //Optional 
$loginUrl = "loginUrl"; //Optional 
$passwordDelegation = "true"; //Optional 
$passwordDelegationApp = "passwordDelegationApp"; //Optional 
$rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional 
$rbaBrowserSmsTemplate = "rbaBrowserSmsTemplate"; //Optional 
$rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional 
$rbaCitySmsTemplate = "rbaCitySmsTemplate"; //Optional 
$rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional 
$rbaCountrySmsTemplate = "rbaCountrySmsTemplate"; //Optional 
$rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional 
$rbaIpSmsTemplate = "rbaIpSmsTemplate"; //Optional 
$rbaOneclickEmailTemplate = "rbaOneclickEmailTemplate"; //Optional 
$rbaOTPSmsTemplate = "rbaOTPSmsTemplate"; //Optional 
$smsTemplate = "smsTemplate"; //Optional 
$verificationUrl = "verificationUrl"; //Optional

$result = $riskBasedAuthenticationAPI->rbaLoginByUserName($payload,$emailTemplate,$fields,$loginUrl,$passwordDelegation,$passwordDelegationApp,$rbaBrowserEmailTemplate,$rbaBrowserSmsTemplate,$rbaCityEmailTemplate,$rbaCitySmsTemplate,$rbaCountryEmailTemplate,$rbaCountrySmsTemplate,$rbaIpEmailTemplate,$rbaIpSmsTemplate,$rbaOneclickEmailTemplate,$rbaOTPSmsTemplate,$smsTemplate,$verificationUrl);
Risk Based Authentication Phone Login (POST)

This API retrieves a copy of the user data based on the Phone More Info

$payload = '{
"password" : "<password>",
"phone" : "<phone>"
}';  //Required 
$emailTemplate = "emailTemplate"; //Optional 
$fields = null; //Optional 
$loginUrl = "loginUrl"; //Optional 
$passwordDelegation = "true"; //Optional 
$passwordDelegationApp = "passwordDelegationApp"; //Optional 
$rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional 
$rbaBrowserSmsTemplate = "rbaBrowserSmsTemplate"; //Optional 
$rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional 
$rbaCitySmsTemplate = "rbaCitySmsTemplate"; //Optional 
$rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional 
$rbaCountrySmsTemplate = "rbaCountrySmsTemplate"; //Optional 
$rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional 
$rbaIpSmsTemplate = "rbaIpSmsTemplate"; //Optional 
$rbaOneclickEmailTemplate = "rbaOneclickEmailTemplate"; //Optional 
$rbaOTPSmsTemplate = "rbaOTPSmsTemplate"; //Optional 
$smsTemplate = "smsTemplate"; //Optional 
$verificationUrl = "verificationUrl"; //Optional

$result = $riskBasedAuthenticationAPI->rbaLoginByPhone($payload,$emailTemplate,$fields,$loginUrl,$passwordDelegation,$passwordDelegationApp,$rbaBrowserEmailTemplate,$rbaBrowserSmsTemplate,$rbaCityEmailTemplate,$rbaCitySmsTemplate,$rbaCountryEmailTemplate,$rbaCountrySmsTemplate,$rbaIpEmailTemplate,$rbaIpSmsTemplate,$rbaOneclickEmailTemplate,$rbaOTPSmsTemplate,$smsTemplate,$verificationUrl);

Sott API

List of APIs in this Section:
GET : Generate SOTT

If you have not already initialized the Sott object do so now

$sottAPI = new SottAPI(); 
Generate SOTT (GET)

This API allows you to generate SOTT with a given expiration time. More Info

$timeDifference = 0; //Optional

$result = $sottAPI->generateSott($timeDifference);

NativeSocial API

List of APIs in this Section:
GET : Access Token via Facebook Token
GET : Access Token via Twitter Token
GET : Access Token via Google Token
GET : Access Token using google JWT token for Native Mobile Login
GET : Access Token via Linkedin Token
GET : Get Access Token By Foursquare Access Token
GET : Access Token via Apple Id Code
GET : Access Token via WeChat Code
GET : Access Token via Google AuthCode

If you have not already initialized the NativeSocial object do so now

$nativeSocialAPI = new NativeSocialAPI(); 
Access Token via Facebook Token (GET)

The API is used to get LoginRadius access token by sending Facebook's access token. It will be valid for the specific duration of time specified in the response. More Info

$fb_Access_Token = "fb_Access_Token"; //Required 
$socialAppName = "socialAppName"; //Optional

$result = $nativeSocialAPI->getAccessTokenByFacebookAccessToken($fb_Access_Token,$socialAppName);
Access Token via Twitter Token (GET)

The API is used to get LoginRadius access token by sending Twitter's access token. It will be valid for the specific duration of time specified in the response. More Info

$tw_Access_Token = "tw_Access_Token"; //Required 
$tw_Token_Secret = "tw_Token_Secret"; //Required 
$socialAppName = "socialAppName"; //Optional

$result = $nativeSocialAPI->getAccessTokenByTwitterAccessToken($tw_Access_Token,$tw_Token_Secret,$socialAppName);
Access Token via Google Token (GET)

The API is used to get LoginRadius access token by sending Google's access token. It will be valid for the specific duration of time specified in the response. More Info

$google_Access_Token = "google_Access_Token"; //Required 
$client_id = "client_id"; //Optional 
$refresh_token = "refresh_token"; //Optional 
$socialAppName = "socialAppName"; //Optional

$result = $nativeSocialAPI->getAccessTokenByGoogleAccessToken($google_Access_Token,$client_id,$refresh_token,$socialAppName);
Access Token using google JWT token for Native Mobile Login (GET)

This API is used to Get LoginRadius Access Token using google jwt id token for google native mobile login/registration. More Info

$id_Token = "id_Token"; //Required

$result = $nativeSocialAPI->getAccessTokenByGoogleJWTAccessToken($id_Token);
Access Token via Linkedin Token (GET)

The API is used to get LoginRadius access token by sending Linkedin's access token. It will be valid for the specific duration of time specified in the response. More Info

$ln_Access_Token = "ln_Access_Token"; //Required 
$socialAppName = "socialAppName"; //Optional

$result = $nativeSocialAPI->getAccessTokenByLinkedinAccessToken($ln_Access_Token,$socialAppName);
Get Access Token By Foursquare Access Token (GET)

The API is used to get LoginRadius access token by sending Foursquare's access token. It will be valid for the specific duration of time specified in the response. More Info

$fs_Access_Token = "fs_Access_Token"; //Required

$result = $nativeSocialAPI->getAccessTokenByFoursquareAccessToken($fs_Access_Token);
Access Token via Apple Id Code (GET)

The API is used to get LoginRadius access token by sending a valid Apple ID OAuth Code. It will be valid for the specific duration of time specified in the response. More Info

$code = "code"; //Required 
$socialAppName = "socialAppName"; //Optional

$result = $nativeSocialAPI->getAccessTokenByAppleIdCode($code,$socialAppName);
Access Token via WeChat Code (GET)

This API is used to retrieve a LoginRadius access token by passing in a valid WeChat OAuth Code. More Info

$code = "code"; //Required

$result = $nativeSocialAPI->getAccessTokenByWeChatCode($code);
Access Token via Google AuthCode (GET)

The API is used to get LoginRadius access token by sending Google's AuthCode. It will be valid for the specific duration of time specified in the response. More Info

$google_authcode = "google_authcode"; //Required 
$socialAppName = "socialAppName"; //Optional

$result = $nativeSocialAPI->getAccessTokenByGoogleAuthCode($google_authcode,$socialAppName);

WebHook API

List of APIs in this Section:
POST : Webhook Subscribe
GET : Webhook Subscribed URLs
GET : Webhook Test
DELETE : WebHook Unsubscribe

If you have not already initialized the WebHook object do so now

$webHookAPI = new WebHookAPI(); 
Webhook Subscribe (POST)

API can be used to configure a WebHook on your LoginRadius site. Webhooks also work on subscribe and notification model, subscribe your hook and get a notification. Equivalent to RESThook but these provide security on basis of signature and RESThook work on unique URL. Following are the events that are allowed by LoginRadius to trigger a WebHook service call. More Info

$payload = '{
"event" : "<event>",
"targetUrl" : "<targetUrl>"
}';  //Required

$result = $webHookAPI->webHookSubscribe($payload);
Webhook Subscribed URLs (GET)

This API is used to fatch all the subscribed URLs, for particular event More Info

$event = "event"; //Required

$result = $webHookAPI->getWebHookSubscribedURLs($event);
Webhook Test (GET)

API can be used to test a subscribed WebHook. More Info

$result = $webHookAPI->webhookTest();
WebHook Unsubscribe (DELETE)

API can be used to unsubscribe a WebHook configured on your LoginRadius site. More Info

$payload = '{
"event" : "<event>",
"targetUrl" : "<targetUrl>"
}';  //Required

$result = $webHookAPI->webHookUnsubscribe($payload);

Generate SOTT Manually

SOTT is a secure one-time token that can be created using the API key, API secret, and a timestamp ( start time and end time ). You can manually create a SOTT using the following utility function.

$startTime="2022-01-10 12:00:00";  // (Optional)  Valid Start Date with Date and time

$endTime="2022-03-10 07:00:00"; //(Optional)  Valid End Date with Date and time

$getLRserverTime=false; //(Optional) If true it will call LoginRadius Get Server Time Api and fetch basic server information and server time information which is useful when generating an SOTT token.

//do not pass the time difference if you are passing startTime & endTime.

$timeDifference =''; // (Optional) The time difference will be used to set the expiration time of SOTT, If you do not pass time difference then the default expiration time of SOTT is 10 minutes.
        

//The LoginRadius API key and primary API secret can be passed additionally, If the credentials will not be passed then this SOTT function will pick the API credentials from the SDK configuration.  
 
$apiKey=""; //(Optional) LoginRadius Api Key

$apiSecret=""; //(Optional) LoginRadius Api Secret (Only Primary Api Secret is used to generate the SOTT manually)

$sottObj = new SOTT();
$sott = $sottObj->getSott($startTime,$endTime,$getLRserverTime,$timeDifference,$apiKey,$apiSecret);

Implement Custom HTTP Client

  • In order to implement custom HTTP client. Create the customhttpclient.php file in your project.
namespace LoginRadiusSDK\Clients\IHttpClient;
use LoginRadiusSDK\Utility\Functions;
use LoginRadiusSDK\LoginRadiusException;

class CustomHttpClient implements IHttpClient {

    public function request($path, $query_array = array(), $options = array()) {
    //custom HTTP client request handler code here
    }
}
  • After that, pass the class name of your custom http client in global variable** $apiClient_class** in your project.

Note: If you manually added LoginRadius SDK then please make sure that customhttpclient.php file included in your project.

global $apiClient_class;
$apiClient_class = 'CustomHttpClient';

Now your Custom HTTP client library will be used to handle LoginRadius APIs.

Demo

Check out the demo and get the full SDK on our Github

Reference Manual

Please find the reference manual here