LoginRadius
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.0.0
Include the following files in your Project Directory
require_once "src/LoginRadiusSDK/Utility/Functions.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/CustomRegistrationDataAPI.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('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
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 which you can get 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\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\CustomRegistrationDataAPI;
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 : 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();
This API is used to update the user's profile by passing the access token. [More Info]( Auth Update Profile by Token (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-update-profile-by-token/)
$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);
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]( Auth Unlock Account by Access Token (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-unlock-account-by-access-token/)
$access_token = "access_token"; //Required
$payload = '{
"g-recaptcha-response" : "<g-recaptcha-response>"
}'; //Required
$result = $authenticationAPI->unlockAccountByToken($access_token,$payload);
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]( Auth Verify Email By OTP (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-verify-email-by-otp/)
$payload = '{
"email" : "<email>",
"otp" : "<otp>"
}'; //Required
$fields = null; //Optional
$url = "url"; //Optional
$welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional
$result = $authenticationAPI->verifyEmailByOTP($payload,$fields,$url,$welcomeEmailTemplate);
This API is used to reset password for the specified account by security question [More Info]( Auth Reset Password by Security Answer and Email (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-email)
$payload = '{
"email" : "<email>",
"password" : "<password>",
"securityAnswer" : {"QuestionID":"Answer"}
}'; //Required
$result = $authenticationAPI->resetPasswordBySecurityAnswerAndEmail($payload);
This API is used to reset password for the specified account by security question [More Info]( Auth Reset Password by Security Answer and Phone (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-phone)
$payload = '{
"password" : "<password>",
"phone" : "<phone>",
"securityAnswer" : {"QuestionID":"Answer"}
}'; //Required
$result = $authenticationAPI->resetPasswordBySecurityAnswerAndPhone($payload);
This API is used to reset password for the specified account by security question [More Info]( Auth Reset Password by Security Answer and UserName (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-username)
$payload = '{
"password" : "<password>",
"securityAnswer" : {"QuestionID":"Answer"},
"userName" : "<userName>"
}'; //Required
$result = $authenticationAPI->resetPasswordBySecurityAnswerAndUserName($payload);
This API is used to set a new password for the specified account. [More Info]( Auth Reset Password by Reset Token (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-reset-token)
$payload = '{
"password" : "<password>",
"resetToken" : "<resetToken>"
}'; //Required
$result = $authenticationAPI->resetPasswordByResetToken($payload);
This API is used to set a new password for the specified account. [More Info]( Auth Reset Password by OTP (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-otp)
$payload = '{
"email" : "<email>",
"otp" : "<otp>",
"password" : "<password>"
}'; //Required
$result = $authenticationAPI->resetPasswordByEmailOTP($payload);
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]( Auth Reset Password by OTP and UserName (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-otp-and-username/)
$payload = '{
"otp" : "<otp>",
"password" : "<password>",
"userName" : "<userName>"
}'; //Required
$result = $authenticationAPI->resetPasswordByOTPAndUserName($payload);
This API is used to change the accounts password based on the previous password [More Info]( Auth Change Password (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-change-password)
$access_token = "access_token"; //Required
$newPassword = "newPassword"; //Required
$oldPassword = "oldPassword"; //Required
$result = $authenticationAPI->changePassword($access_token,$newPassword,$oldPassword);
This API is used to set or change UserName by access token. [More Info]( Auth Set or Change UserName (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-set-or-change-user-name/)
$access_token = "access_token"; //Required
$username = "username"; //Required
$result = $authenticationAPI->setOrChangeUserName($access_token,$username);
This API resends the verification email to the user. [More Info]( Auth Resend Email Verification (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-resend-email-verification/)
$email = "email"; //Required
$emailTemplate = "emailTemplate"; //Optional
$verificationUrl = "verificationUrl"; //Optional
$result = $authenticationAPI->authResendEmailVerification($email,$emailTemplate,$verificationUrl);
This API is used to add additional emails to a user's account. [More Info]( Auth Add Email (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-add-email)
$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);
This API retrieves a copy of the user data based on the Email [More Info]( Auth Login by Email (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-login-by-email)
$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);
This API retrieves a copy of the user data based on the Username [More Info]( Auth Login by Username (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-login-by-username)
$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);
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]( Auth Forgot Password (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-forgot-password)
$email = "email"; //Required
$resetPasswordUrl = "resetPasswordUrl"; //Required
$emailTemplate = "emailTemplate"; //Optional
$result = $authenticationAPI->forgotPassword($email,$resetPasswordUrl,$emailTemplate);
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]( Auth Link Social Identities (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-link-social-identities)
$access_token = "access_token"; //Required
$candidateToken = "candidateToken"; //Required
$result = $authenticationAPI->linkSocialIdentities($access_token,$candidateToken);
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]( Auth Link Social Identities By Ping (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-link-social-identities-by-ping)
$access_token = "access_token"; //Required
$clientGuid = "clientGuid"; //Required
$result = $authenticationAPI->linkSocialIdentitiesByPing($access_token,$clientGuid);
This API creates a user in the database as well as sends a verification email to the user. [More Info]( Auth User Registration by Email (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-user-registration-by-email)
$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);
This API creates a user in the database as well as sends a verification email to the user. [More Info]( Auth User Registration By Captcha (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-user-registration-by-recaptcha)
$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);
This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. [More Info]( Get Security Questions By Email (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-email/)
$email = "email"; //Required
$result = $authenticationAPI->getSecurityQuestionsByEmail($email);
This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. [More Info]( Get Security Questions By UserName (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-user-name/)
$userName = "userName"; //Required
$result = $authenticationAPI->getSecurityQuestionsByUserName($userName);
This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. [More Info]( Get Security Questions By Phone (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-phone/)
$phone = "phone"; //Required
$result = $authenticationAPI->getSecurityQuestionsByPhone($phone);
This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. [More Info]( Get Security Questions By Access Token (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-access-token/)
$access_token = "access_token"; //Required
$result = $authenticationAPI->getSecurityQuestionsByAccessToken($access_token);
This api validates access token, if valid then returns a response with its expiry otherwise error. [More Info]( Auth Validate Access token (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-validate-access-token/)
$access_token = "access_token"; //Required
$result = $authenticationAPI->authValidateAccessToken($access_token);
This api call invalidates the active access token or expires an access token's validity. [More Info]( Access Token Invalidate (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-invalidate-access-token/)
$access_token = "access_token"; //Required
$preventRefresh = "true"; //Optional
$result = $authenticationAPI->authInValidateAccessToken($access_token,$preventRefresh);
This api call provide the active access token Information [More Info]( Access Token Info (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-access-token-info/)
$access_token = "access_token"; //Required
$result = $authenticationAPI->getAccessTokenInfo($access_token);
This API retrieves a copy of the user data based on the access token. [More Info]( Auth Read all Profiles by Token (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-read-profiles-by-token/)
$access_token = "access_token"; //Required
$fields = null; //Optional
$result = $authenticationAPI->getProfileByAccessToken($access_token,$fields);
This API sends a welcome email [More Info]( Auth Send Welcome Email (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-send-welcome-email/)
$access_token = "access_token"; //Required
$welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional
$result = $authenticationAPI->sendWelcomeEmail($access_token,$welcomeEmailTemplate);
This API is used to delete an account by passing it a delete token. [More Info]( Auth Delete Account (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-delete-account/)
$deletetoken = "deletetoken"; //Required
$result = $authenticationAPI->deleteAccountByDeleteToken($deletetoken);
This API is used to check the email exists or not on your site. [More Info]( Auth Check Email Availability (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-email-availability/)
$email = "email"; //Required
$result = $authenticationAPI->checkEmailAvailability($email);
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]( Auth Verify Email (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-verify-email/)
$verificationToken = "verificationToken"; //Required
$fields = null; //Optional
$url = "url"; //Optional
$welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional
$result = $authenticationAPI->verifyEmail($verificationToken,$fields,$url,$welcomeEmailTemplate);
This API is used to check the UserName exists or not on your site. [More Info]( Auth Check UserName Availability (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-username-availability/)
$username = "username"; //Required
$result = $authenticationAPI->checkUserNameAvailability($username);
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]( Auth Privacy Policy Accept (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-privacy-policy-accept)
$access_token = "access_token"; //Required
$fields = null; //Optional
$result = $authenticationAPI->acceptPrivacyPolicy($access_token,$fields);
This API will return all the accepted privacy policies for the user by providing the access token of that user. [More Info]( Auth Privacy Policy History By Access Token (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/privacy-policy-history-by-access-token/)
$access_token = "access_token"; //Required
$result = $authenticationAPI->getPrivacyPolicyHistoryByAccessToken($access_token);
This API will send a confirmation email for account deletion to the customer's email when passed the customer's access token [More Info]( Auth Delete Account with Email Confirmation (DELETE)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-delete-account-with-email-confirmation/)
$access_token = "access_token"; //Required
$deleteUrl = "deleteUrl"; //Optional
$emailTemplate = "emailTemplate"; //Optional
$result = $authenticationAPI->deleteAccountWithEmailConfirmation($access_token,$deleteUrl,$emailTemplate);
This API is used to remove additional emails from a user's account. [More Info]( Auth Remove Email (DELETE)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-remove-email)
$access_token = "access_token"; //Required
$email = "email"; //Required
$result = $authenticationAPI->removeEmail($access_token,$email);
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]( Auth Unlink Social Identities (DELETE)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-unlink-social-identities)
$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
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();
This API is used to update the information of existing accounts in your Cloud Storage. See our Advanced API Usage section Account Update (PUT)Here for more capabilities. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-update)
$payload = '{
"firstName" : "<firstName>",
"lastName" : "<lastName>"
}'; //Required
$uid = "uid"; //Required
$fields = null; //Optional
$nullSupport = "true"; //Optional
$result = $accountAPI->updateAccountByUid($payload,$uid,$fields,$nullSupport);
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]( Update Phone ID by UID (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/account/update-phoneid-by-uid)
$phone = "phone"; //Required
$uid = "uid"; //Required
$fields = null; //Optional
$result = $accountAPI->updatePhoneIDByUid($phone,$uid,$fields);
This API is used to set the password of an account in Cloud Storage. [More Info]( Account Set Password (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-set-password)
$password = "password"; //Required
$uid = "uid"; //Required
$result = $accountAPI->setAccountPasswordByUid($password,$uid);
This API is used to invalidate the Email Verification status on an account. [More Info]( Account Invalidate Verification Email (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-invalidate-verification-email)
$uid = "uid"; //Required
$emailTemplate = "emailTemplate"; //Optional
$verificationUrl = "verificationUrl"; //Optional
$result = $accountAPI->invalidateAccountEmailVerification($uid,$emailTemplate,$verificationUrl);
This API Allows you to reset the phone no verification of an end user’s account. [More Info]( Reset phone ID verification (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/reset-phone-id-verification)
$uid = "uid"; //Required
$smsTemplate = "smsTemplate"; //Optional
$result = $accountAPI->resetPhoneIDVerificationByUid($uid,$smsTemplate);
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]( Upsert Email (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/account/upsert-email)
$payload = '{
"email" : [ {
"type" : "<type>" ,
"value" : "<value>"
} ]
}'; //Required
$uid = "uid"; //Required
$fields = null; //Optional
$result = $accountAPI->upsertEmail($payload,$uid,$fields);
This API is used to create an account in Cloud Storage. This API bypass the normal email verification process and manually creates the user. Account Create (POST)
In order to use this API, you need to format a JSON request body with all of the mandatory fields [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-create)
$payload = '{
"email" : [ {
"type" : "<type>" ,
"value" : "<value>"
} ] ,
"firstName" : "<firstName>",
"lastName" : "<lastName>",
"password" : "<password>"
}'; //Required
$fields = null; //Optional
$result = $accountAPI->createAccount($payload,$fields);
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]( Forgot Password token (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/account/get-forgot-password-token)
$email = "email"; //Required
$emailTemplate = "emailTemplate"; //Optional
$resetPasswordUrl = "resetPasswordUrl"; //Optional
$sendEmail = "true"; //Optional
$result = $accountAPI->getForgotPasswordToken($email,$emailTemplate,$resetPasswordUrl,$sendEmail);
This API Returns an Email Verification token. [More Info]( Email Verification token (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/account/get-email-verification-token)
$email = "email"; //Required
$result = $accountAPI->getEmailVerificationToken($email);
This API is used to retrieve all of the accepted Policies by the user, associated with their UID. [More Info]( Get Privacy Policy History By Uid (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/account/privacy-policy-history-by-uid/)
$uid = "uid"; //Required
$result = $accountAPI->getPrivacyPolicyHistoryByUid($uid);
This API is used to retrieve all of the profile data, associated with the specified account by email in Cloud Storage. [More Info]( Account Profiles by Email (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-email)
$email = "email"; //Required
$fields = null; //Optional
$result = $accountAPI->getAccountProfileByEmail($email,$fields);
This API is used to retrieve all of the profile data associated with the specified account by user name in Cloud Storage. [More Info]( Account Profiles by Username (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-user-name)
$userName = "userName"; //Required
$fields = null; //Optional
$result = $accountAPI->getAccountProfileByUserName($userName,$fields);
This API is used to retrieve all of the profile data, associated with the account by phone number in Cloud Storage. [More Info]( Account Profile by Phone ID (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-phone-id/)
$phone = "phone"; //Required
$fields = null; //Optional
$result = $accountAPI->getAccountProfileByPhone($phone,$fields);
This API is used to retrieve all of the profile data, associated with the account by uid in Cloud Storage. [More Info]( Account Profiles by UID (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-uid)
$uid = "uid"; //Required
$fields = null; //Optional
$result = $accountAPI->getAccountProfileByUid($uid,$fields);
This API use to retrieve the hashed password of a specified account in Cloud Storage. [More Info]( Account Password (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-password)
$uid = "uid"; //Required
$result = $accountAPI->getAccountPasswordHashByUid($uid);
The API is used to get LoginRadius access token based on UID. [More Info]( Access Token based on UID or User impersonation API (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-impersonation-api)
$uid = "uid"; //Required
$result = $accountAPI->getAccessTokenByUid($uid);
This API is used to refresh an access token via it's associated refresh token. [More Info]( Refresh Access Token by Refresh Token (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/refresh-access-token-by-refresh-token)
$refresh_Token = "refresh_Token"; //Required
$result = $accountAPI->refreshAccessTokenByRefreshToken($refresh_Token);
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]( Revoke Refresh Token (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/revoke-refresh-token)
$refresh_Token = "refresh_Token"; //Required
$result = $accountAPI->revokeRefreshToken($refresh_Token);
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]( Account Identities by Email (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-identities-by-email)
$email = "email"; //Required
$fields = null; //Optional
$result = $accountAPI->getAccountIdentitiesByEmail($email,$fields);
This API deletes the Users account and allows them to re-register for a new account. [More Info]( Account Delete (DELETE)https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-delete)
$uid = "uid"; //Required
$result = $accountAPI->deleteAccountByUid($uid);
Use this API to Remove emails from a user Account [More Info]( Account Remove Email (DELETE)https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-email-delete)
$email = "email"; //Required
$uid = "uid"; //Required
$fields = null; //Optional
$result = $accountAPI->removeEmail($email,$uid,$fields);
This API is used to delete all user profiles associated with an Email. [More Info]( Delete User Profiles By Email (DELETE)https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-email-delete/)
$email = "email"; //Required
$result = $accountAPI->accountDeleteByEmail($email);
Social API
List of APIs in this Section:
POST : Post Message API
POST : Status Posting
POST : Trackable Status Posting
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
GET : Album
GET : Get Albums with cursor
GET : Audio
GET : Get Audio With Cursor
GET : Check In
GET : Get CheckIns With Cursor
GET : Contact
GET : Event
GET : Get Events With Cursor
GET : Following
GET : Get Followings With Cursor
GET : Group
GET : Get Groups With Cursor
GET : Like
GET : Get Likes With Cursor
GET : Mention
GET : Page
GET : Photo
GET : Get Post
GET : Get Trackable Status Stats
GET : Trackable Status Fetching
GET : User Profile
GET : Refresh User Profile
GET : Video
If you have not already initialized the Social object do so now
$socialAPI = new SocialAPI();
Post Message API is used to post messages to the user's contacts. Post Message API (POST)
Supported Providers: Twitter, LinkedIn
The Message API is used to post messages to the user?s contacts. This is one of the APIs that makes up the LoginRadius Friend Invite System. After using the Contact API, you can send messages to the retrieved contacts. This API requires setting permissions in your LoginRadius Dashboard.
GET & POST Message API work the same way except the API method is different [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/post-message-api)
$access_Token = "access_Token"; //Required
$message = "message"; //Required
$subject = "subject"; //Required
$to = "to"; //Required
$result = $socialAPI->postMessage($access_Token,$message,$subject,$to);
The Status API is used to update the status on the user's wall. Status Posting (POST)
Supported Providers: Facebook, Twitter, LinkedIn [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/status-posting/)
$access_Token = "access_Token"; //Required
$caption = "caption"; //Required
$description = "description"; //Required
$imageurl = "imageurl"; //Required
$status = "status"; //Required
$title = "title"; //Required
$url = "url"; //Required
$shorturl = "shorturl"; //Optional
$result = $socialAPI->statusPosting($access_Token,$caption,$description,$imageurl,$status,$title,$url,$shorturl);
The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard. Trackable Status Posting (POST)
The Trackable Status API is used to update the status on the user's wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications.
POST Input Parameter Format: application/x-www-form-urlencoded [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/trackable-status-posting/)
$access_Token = "access_Token"; //Required
$payload = '{
"caption" : "<caption>",
"description" : "<description>",
"imageurl" : "<imageurl>",
"status" : "<status>",
"title" : "<title>",
"url" : "<url>"
}'; //Required
$result = $socialAPI->trackableStatusPosting($access_Token,$payload);
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]( Access Token (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/access-token)
$token = "token"; //Required
$result = $socialAPI->exchangeAccessToken($token);
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. Refresh Token (GET)
Supported Providers : Facebook,Yahoo,Google,Twitter, Linkedin.
Contact LoginRadius support team to enable this API. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/refresh-token)
$access_Token = "access_Token"; //Required
$expiresIn = 0; //Optional
$isWeb = "true"; //Optional
$result = $socialAPI->refreshAccessToken($access_Token,$expiresIn,$isWeb);
This API validates access token, if valid then returns a response with its expiry otherwise error. [More Info]( Token Validate (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/validate-access-token)
$access_token = "access_token"; //Required
$result = $socialAPI->validateAccessToken($access_token);
This api invalidates the active access token or expires an access token validity. [More Info]( Access Token Invalidate (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/invalidate-access-token)
$access_token = "access_token"; //Required
$result = $socialAPI->inValidateAccessToken($access_token);
This api is use to get all active session by Access Token. [More Info]( Get Active Session Details (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/get-active-session-details)
$token = "token"; //Required
$result = $socialAPI->getActiveSession($token);
This api is used to get all active sessions by AccountID(UID). [More Info]( Get Active Session By Account Id (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/active-session-by-account-id/)
$accountId = "accountId"; //Required
$result = $socialAPI->getActiveSessionByAccountID($accountId);
This api is used to get all active sessions by ProfileId. [More Info]( Get Active Session By Profile Id (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/active-session-by-profile-id/)
$profileId = "profileId"; //Required
$result = $socialAPI->getActiveSessionByProfileID($profileId);
Supported Providers: Facebook, Google, Live, Vkontakte. Album (GET)
This API returns the photo albums associated with the passed in access tokens Social Profile. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/album/)
$access_Token = "access_Token"; //Required
$result = $socialAPI->getAlbums($access_Token);
Supported Providers: Facebook, Google, Live, Vkontakte. Get Albums with cursor (GET)
This API returns the photo albums associated with the passed in access tokens Social Profile. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/album/)
$access_Token = "access_Token"; //Required
$nextCursor = "nextCursor"; //Required
$result = $socialAPI->getAlbumsWithCursor($access_Token,$nextCursor);
The Audio API is used to get audio files data from the user's social account. Audio (GET)
Supported Providers: Live, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/audio)
$access_Token = "access_Token"; //Required
$result = $socialAPI->getAudios($access_Token);
The Audio API is used to get audio files data from the user's social account. Get Audio With Cursor (GET)
Supported Providers: Live, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/audio)
$access_Token = "access_Token"; //Required
$nextCursor = "nextCursor"; //Required
$result = $socialAPI->getAudiosWithCursor($access_Token,$nextCursor);
The Check In API is used to get check Ins data from the user's social account. Check In (GET)
Supported Providers: Facebook, Foursquare, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/check-in)
$access_Token = "access_Token"; //Required
$result = $socialAPI->getCheckIns($access_Token);
The Check In API is used to get check Ins data from the user's social account. Get CheckIns With Cursor (GET)
Supported Providers: Facebook, Foursquare, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/check-in)
$access_Token = "access_Token"; //Required
$nextCursor = "nextCursor"; //Required
$result = $socialAPI->getCheckInsWithCursor($access_Token,$nextCursor);
The Contact API is used to get contacts/friends/connections data from the user's social account.This is one of the APIs that makes up the LoginRadius Friend Invite System. The data will normalized into LoginRadius' standard data format. This API requires setting permissions in your LoginRadius Dashboard. Contact (GET)
Note: Facebook restricts access to the list of friends that is returned. When using the Contacts API with Facebook you will only receive friends that have accepted some permissions with your app.
Supported Providers: Facebook, Foursquare, Google, LinkedIn, Live, Twitter, Vkontakte, Yahoo [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/contact)
$access_Token = "access_Token"; //Required
$nextCursor = "nextCursor"; //Optional
$result = $socialAPI->getContacts($access_Token,$nextCursor);
The Event API is used to get the event data from the user's social account. Event (GET)
Supported Providers: Facebook, Live [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/event)
$access_Token = "access_Token"; //Required
$result = $socialAPI->getEvents($access_Token);
The Event API is used to get the event data from the user's social account. Get Events With Cursor (GET)
Supported Providers: Facebook, Live [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/event)
$access_Token = "access_Token"; //Required
$nextCursor = "nextCursor"; //Required
$result = $socialAPI->getEventsWithCursor($access_Token,$nextCursor);
Get the following user list from the user's social account. Following (GET)
Supported Providers: Twitter [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/following)
$access_Token = "access_Token"; //Required
$result = $socialAPI->getFollowings($access_Token);
Get the following user list from the user's social account. Get Followings With Cursor (GET)
Supported Providers: Twitter [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/following)
$access_Token = "access_Token"; //Required
$nextCursor = "nextCursor"; //Required
$result = $socialAPI->getFollowingsWithCursor($access_Token,$nextCursor);
The Group API is used to get group data from the user's social account. Group (GET)
Supported Providers: Facebook, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/group)
$access_Token = "access_Token"; //Required
$result = $socialAPI->getGroups($access_Token);
The Group API is used to get group data from the user's social account. Get Groups With Cursor (GET)
Supported Providers: Facebook, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/group)
$access_Token = "access_Token"; //Required
$nextCursor = "nextCursor"; //Required
$result = $socialAPI->getGroupsWithCursor($access_Token,$nextCursor);
The Like API is used to get likes data from the user's social account. Like (GET)
Supported Providers: Facebook [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/like)
$access_Token = "access_Token"; //Required
$result = $socialAPI->getLikes($access_Token);
The Like API is used to get likes data from the user's social account. Get Likes With Cursor (GET)
Supported Providers: Facebook [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/like)
$access_Token = "access_Token"; //Required
$nextCursor = "nextCursor"; //Required
$result = $socialAPI->getLikesWithCursor($access_Token,$nextCursor);
The Mention API is used to get mentions data from the user's social account. Mention (GET)
Supported Providers: Twitter [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/mention)
$access_Token = "access_Token"; //Required
$result = $socialAPI->getMentions($access_Token);
The Page API is used to get the page data from the user's social account. Page (GET)
Supported Providers: Facebook, LinkedIn [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/page)
$access_Token = "access_Token"; //Required
$pageName = "pageName"; //Required
$result = $socialAPI->getPage($access_Token,$pageName);
The Photo API is used to get photo data from the user's social account. Photo (GET)
Supported Providers: Facebook, Foursquare, Google, Live, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/photo)
$access_Token = "access_Token"; //Required
$albumId = "albumId"; //Required
$result = $socialAPI->getPhotos($access_Token,$albumId);
The Post API is used to get post message data from the user's social account. Get Post (GET)
Supported Providers: Facebook [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/post)
$access_Token = "access_Token"; //Required
$result = $socialAPI->getPosts($access_Token);
The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard. Get Trackable Status Stats (GET)
The Trackable Status API is used to update the status on the user's wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/get-trackable-status-stats/)
$access_Token = "access_Token"; //Required
$caption = "caption"; //Required
$description = "description"; //Required
$imageurl = "imageurl"; //Required
$status = "status"; //Required
$title = "title"; //Required
$url = "url"; //Required
$result = $socialAPI->getTrackableStatusStats($access_Token,$caption,$description,$imageurl,$status,$title,$url);
The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard. Trackable Status Fetching (GET)
This API is used to retrieve a tracked post based on the passed in post ID value. This API requires setting permissions in your LoginRadius Dashboard.
Note: To utilize this API you need to find the ID for the post you want to track, which might require using Trackable Status Posting API first. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/trackable-status-fetching/)
$postId = "postId"; //Required
$result = $socialAPI->trackableStatusFetching($postId);
The User Profile API is used to get social profile data from the user's social account after authentication. User Profile (GET)
Supported Providers: All [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/user-profile)
$access_Token = "access_Token"; //Required
$fields = null; //Optional
$result = $socialAPI->getSocialUserProfile($access_Token,$fields);
The User Profile API is used to get the latest updated social profile data from the user's social account after authentication. The social profile will be retrieved via oAuth and OpenID protocols. The data is normalized into LoginRadius' standard data format. This API should be called using the access token retrieved from the refresh access token API. [More Info]( Refresh User Profile (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/refresh-user-profile)
$access_Token = "access_Token"; //Required
$fields = null; //Optional
$result = $socialAPI->getRefreshedSocialUserProfile($access_Token,$fields);
The Video API is used to get video files data from the user's social account. Video (GET)
Supported Providers: Facebook, Google, Live, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/video)
$access_Token = "access_Token"; //Required
$nextCursor = "nextCursor"; //Required
$result = $socialAPI->getVideos($access_Token,$nextCursor);
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();
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]( Custom Object Update by Access Token (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-update-by-objectrecordid-and-token)
$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);
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]( Custom Object Update by UID (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-update-by-objectrecordid-and-uid)
$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);
This API is used to write information in JSON format to the custom object for the specified account. [More Info]( Create Custom Object by Token (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/create-custom-object-by-token)
$access_token = "access_token"; //Required
$objectName = "objectName"; //Required
$payload = '{"customdata1": "Store my customdata1 value" }'; //Required
$result = $customObjectAPI->createCustomObjectByToken($access_token,$objectName,$payload);
This API is used to write information in JSON format to the custom object for the specified account. [More Info]( Create Custom Object by UID (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/create-custom-object-by-uid)
$objectName = "objectName"; //Required
$payload = '{"customdata1": "Store my customdata1 value" }'; //Required
$uid = "uid"; //Required
$result = $customObjectAPI->createCustomObjectByUid($objectName,$payload,$uid);
This API is used to retrieve the specified Custom Object data for the specified account. [More Info]( Custom Object by Token (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-by-token)
$access_token = "access_token"; //Required
$objectName = "objectName"; //Required
$result = $customObjectAPI->getCustomObjectByToken($access_token,$objectName);
This API is used to retrieve the Custom Object data for the specified account. [More Info]( Custom Object by ObjectRecordId and Token (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-by-objectrecordid-and-token)
$access_token = "access_token"; //Required
$objectName = "objectName"; //Required
$objectRecordId = "objectRecordId"; //Required
$result = $customObjectAPI->getCustomObjectByRecordIDAndToken($access_token,$objectName,$objectRecordId);
This API is used to retrieve all the custom objects by UID from cloud storage. [More Info]( Custom Object By UID (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-by-uid)
$objectName = "objectName"; //Required
$uid = "uid"; //Required
$result = $customObjectAPI->getCustomObjectByUid($objectName,$uid);
This API is used to retrieve the Custom Object data for the specified account. [More Info]( Custom Object by ObjectRecordId and UID (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-by-objectrecordid-and-uid)
$objectName = "objectName"; //Required
$objectRecordId = "objectRecordId"; //Required
$uid = "uid"; //Required
$result = $customObjectAPI->getCustomObjectByRecordID($objectName,$objectRecordId,$uid);
This API is used to remove the specified Custom Object data using ObjectRecordId of a specified account. [More Info]( Custom Object Delete by Record Id And Token (DELETE)https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-delete-by-objectrecordid-and-token)
$access_token = "access_token"; //Required
$objectName = "objectName"; //Required
$objectRecordId = "objectRecordId"; //Required
$result = $customObjectAPI->deleteCustomObjectByToken($access_token,$objectName,$objectRecordId);
This API is used to remove the specified Custom Object data using ObjectRecordId of specified account. [More Info]( Account Delete Custom Object by ObjectRecordId (DELETE)https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-delete-by-objectrecordid-and-uid)
$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();
This API is used to reset the password [More Info]( Phone Reset Password by OTP (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-reset-password-by-otp)
$payload = '{
"otp" : "<otp>",
"password" : "<password>",
"phone" : "<phone>"
}'; //Required
$result = $phoneAuthenticationAPI->resetPasswordByPhoneOTP($payload);
This API is used to validate the verification code sent to verify a user's phone number [More Info]( Phone Verification OTP (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-verify-otp)
$otp = "otp"; //Required
$phone = "phone"; //Required
$fields = null; //Optional
$smsTemplate = "smsTemplate"; //Optional
$result = $phoneAuthenticationAPI->phoneVerificationByOTP($otp,$phone,$fields,$smsTemplate);
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]( Phone Verification OTP by Token (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-verify-otp-by-token)
$access_token = "access_token"; //Required
$otp = "otp"; //Required
$smsTemplate = "smsTemplate"; //Optional
$result = $phoneAuthenticationAPI->phoneVerificationOTPByAccessToken($access_token,$otp,$smsTemplate);
This API is used to update the login Phone Number of users [More Info]( Phone Number Update (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-number-update)
$access_token = "access_token"; //Required
$phone = "phone"; //Required
$smsTemplate = "smsTemplate"; //Optional
$result = $phoneAuthenticationAPI->updatePhoneNumber($access_token,$phone,$smsTemplate);
This API retrieves a copy of the user data based on the Phone [More Info]( Phone Login (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-login)
$payload = '{
"password" : "<password>",
"phone" : "<phone>"
}'; //Required
$fields = null; //Optional
$loginUrl = "loginUrl"; //Optional
$smsTemplate = "smsTemplate"; //Optional
$result = $phoneAuthenticationAPI->loginByPhone($payload,$fields,$loginUrl,$smsTemplate);
This API is used to send the OTP to reset the account password. [More Info]( Phone Forgot Password by OTP (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-forgot-password-by-otp)
$phone = "phone"; //Required
$smsTemplate = "smsTemplate"; //Optional
$result = $phoneAuthenticationAPI->forgotPasswordByPhoneOTP($phone,$smsTemplate);
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 Resend Verification OTP (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-resend-otp)
$phone = "phone"; //Required
$smsTemplate = "smsTemplate"; //Optional
$result = $phoneAuthenticationAPI->phoneResendVerificationOTP($phone,$smsTemplate);
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]( Phone Resend Verification OTP By Token (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-resend-otp-by-token)
$access_token = "access_token"; //Required
$phone = "phone"; //Required
$smsTemplate = "smsTemplate"; //Optional
$result = $phoneAuthenticationAPI->phoneResendVerificationOTPByToken($access_token,$phone,$smsTemplate);
This API registers the new users into your Cloud Storage and triggers the phone verification process. [More Info]( Phone User Registration by SMS (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-user-registration-by-sms)
$payload = '{
"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
$result = $phoneAuthenticationAPI->userRegistrationByPhone($payload,$sott,$fields,$options,$smsTemplate,$verificationUrl,$welcomeEmailTemplate);
This API is used to check the Phone Number exists or not on your site. [More Info]( Phone Number Availability (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-number-availability)
$phone = "phone"; //Required
$result = $phoneAuthenticationAPI->checkPhoneNumberAvailability($phone);
This API is used to delete the Phone ID on a user's account via the access token [More Info]( Remove Phone ID by Access Token (DELETE)https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/remove-phone-id-by-access-token)
$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 : MFA Validate OTP
PUT : MFA Validate Google Auth Code
PUT : MFA Validate Backup code
PUT : MFA Update Phone Number
POST : MFA Email Login
POST : MFA UserName Login
POST : MFA Phone Login
GET : MFA Validate Access Token
GET : MFA Backup Code by Access Token
GET : Reset Backup Code 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 : MFA Reset SMS Authenticator By UID
DELETE : MFA Reset Google Authenticator By UID
If you have not already initialized the MultiFactorAuthentication object do so now
$multiFactorAuthenticationAPI = new MultiFactorAuthenticationAPI();
This API is used to trigger the Multi-factor authentication settings after login for secure actions [More Info]( Update MFA Setting (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/update-mfa-setting/)
$access_token = "access_token"; //Required
$payload = '{
"otp" : "<otp>"
}'; //Required
$fields = null; //Optional
$result = $multiFactorAuthenticationAPI->mfaUpdateSetting($access_token,$payload,$fields);
This API is used to Enable Multi-factor authentication by access token on user login [More Info]( Update MFA by Access Token (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/google-authenticator/update-mfa-by-access-token/)
$access_token = "access_token"; //Required
$payload = '{
"googleAuthenticatorCode" : "<googleAuthenticatorCode>"
}'; //Required
$fields = null; //Optional
$smsTemplate = "smsTemplate"; //Optional
$result = $multiFactorAuthenticationAPI->mfaUpdateByAccessToken($access_token,$payload,$fields,$smsTemplate);
This API is used to update the Multi-factor authentication phone number by sending the verification OTP to the provided phone number [More Info]( MFA Update Phone Number by Token (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-update-phone-number-by-token/)
$access_token = "access_token"; //Required
$phoneNo2FA = "phoneNo2FA"; //Required
$smsTemplate2FA = "smsTemplate2FA"; //Optional
$result = $multiFactorAuthenticationAPI->mfaUpdatePhoneNumberByToken($access_token,$phoneNo2FA,$smsTemplate2FA);
This API is used to login via Multi-factor authentication by passing the One Time Password received via SMS [More Info]( MFA Validate OTP (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-validate-otp/)
$payload = '{
"otp" : "<otp>"
}'; //Required
$secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required
$fields = null; //Optional
$smsTemplate2FA = "smsTemplate2FA"; //Optional
$result = $multiFactorAuthenticationAPI->mfaValidateOTPByPhone($payload,$secondFactorAuthenticationToken,$fields,$smsTemplate2FA);
This API is used to login via Multi-factor-authentication by passing the google authenticator code. [More Info]( MFA Validate Google Auth Code (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/google-authenticator/mfa-validate-google-auth-code/)
$googleAuthenticatorCode = "googleAuthenticatorCode"; //Required
$secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required
$fields = null; //Optional
$smsTemplate2FA = "smsTemplate2FA"; //Optional
$result = $multiFactorAuthenticationAPI->mfaValidateGoogleAuthCode($googleAuthenticatorCode,$secondFactorAuthenticationToken,$fields,$smsTemplate2FA);
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 in case 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]( MFA Validate Backup code (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/mfa-validate-backup-code/)
$payload = '{
"backupCode" : "<backupCode>"
}'; //Required
$secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required
$fields = null; //Optional
$result = $multiFactorAuthenticationAPI->mfaValidateBackupCode($payload,$secondFactorAuthenticationToken,$fields);
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]( MFA Update Phone Number (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-update-phone-number/)
$phoneNo2FA = "phoneNo2FA"; //Required
$secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required
$smsTemplate2FA = "smsTemplate2FA"; //Optional
$result = $multiFactorAuthenticationAPI->mfaUpdatePhoneNumber($phoneNo2FA,$secondFactorAuthenticationToken,$smsTemplate2FA);
This API can be used to login by emailid on a Multi-factor authentication enabled LoginRadius site. [More Info]( MFA Email Login (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-email-login)
$email = "email"; //Required
$password = "password"; //Required
$emailTemplate = "emailTemplate"; //Optional
$fields = null; //Optional
$loginUrl = "loginUrl"; //Optional
$smsTemplate = "smsTemplate"; //Optional
$smsTemplate2FA = "smsTemplate2FA"; //Optional
$verificationUrl = "verificationUrl"; //Optional
$result = $multiFactorAuthenticationAPI->mfaLoginByEmail($email,$password,$emailTemplate,$fields,$loginUrl,$smsTemplate,$smsTemplate2FA,$verificationUrl);
This API can be used to login by username on a Multi-factor authentication enabled LoginRadius site. [More Info]( MFA UserName Login (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-user-name-login)
$password = "password"; //Required
$username = "username"; //Required
$emailTemplate = "emailTemplate"; //Optional
$fields = null; //Optional
$loginUrl = "loginUrl"; //Optional
$smsTemplate = "smsTemplate"; //Optional
$smsTemplate2FA = "smsTemplate2FA"; //Optional
$verificationUrl = "verificationUrl"; //Optional
$result = $multiFactorAuthenticationAPI->mfaLoginByUserName($password,$username,$emailTemplate,$fields,$loginUrl,$smsTemplate,$smsTemplate2FA,$verificationUrl);
This API can be used to login by Phone on a Multi-factor authentication enabled LoginRadius site. [More Info]( MFA Phone Login (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-phone-login)
$password = "password"; //Required
$phone = "phone"; //Required
$emailTemplate = "emailTemplate"; //Optional
$fields = null; //Optional
$loginUrl = "loginUrl"; //Optional
$smsTemplate = "smsTemplate"; //Optional
$smsTemplate2FA = "smsTemplate2FA"; //Optional
$verificationUrl = "verificationUrl"; //Optional
$result = $multiFactorAuthenticationAPI->mfaLoginByPhone($password,$phone,$emailTemplate,$fields,$loginUrl,$smsTemplate,$smsTemplate2FA,$verificationUrl);
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]( MFA Validate Access Token (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-validate-access-token/)
$access_token = "access_token"; //Required
$smsTemplate2FA = "smsTemplate2FA"; //Optional
$result = $multiFactorAuthenticationAPI->mfaConfigureByAccessToken($access_token,$smsTemplate2FA);
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]( MFA Backup Code by Access Token (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/mfa-backup-code-by-access-token/)
$access_token = "access_token"; //Required
$result = $multiFactorAuthenticationAPI->mfaBackupCodeByAccessToken($access_token);
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]( Reset Backup Code by Access Token (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/mfa-reset-backup-code-by-access-token/)
$access_token = "access_token"; //Required
$result = $multiFactorAuthenticationAPI->mfaResetBackupCodeByAccessToken($access_token);
This API is used to resending the verification OTP to the provided phone number [More Info]( MFA Resend Otp (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/resend-twofactorauthentication-otp/)
$secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required
$smsTemplate2FA = "smsTemplate2FA"; //Optional
$result = $multiFactorAuthenticationAPI->mfaResendOTP($secondFactorAuthenticationToken,$smsTemplate2FA);
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]( MFA Backup Code by UID (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/mfa-backup-code-by-uid/)
$uid = "uid"; //Required
$result = $multiFactorAuthenticationAPI->mfaBackupCodeByUid($uid);
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]( MFA Reset Backup Code by UID (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/mfa-reset-backup-code-by-uid/)
$uid = "uid"; //Required
$result = $multiFactorAuthenticationAPI->mfaResetBackupCodeByUid($uid);
This API Resets the Google Authenticator configurations on a given account via the access token [More Info]( MFA Reset Google Authenticator by Token (DELETE)https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/google-authenticator/mfa-reset-google-authenticator-by-token/)
$access_token = "access_token"; //Required
$googleauthenticator = "true"; //Required
$result = $multiFactorAuthenticationAPI->mfaResetGoogleAuthByToken($access_token,$googleauthenticator);
This API resets the SMS Authenticator configurations on a given account via the access token. [More Info]( MFA Reset SMS Authenticator by Token (DELETE)https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-reset-sms-authenticator-by-token/)
$access_token = "access_token"; //Required
$otpauthenticator = "true"; //Required
$result = $multiFactorAuthenticationAPI->mfaResetSMSAuthByToken($access_token,$otpauthenticator);
This API resets the SMS Authenticator configurations on a given account via the UID. [More Info]( MFA Reset SMS Authenticator By UID (DELETE)https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-reset-sms-authenticator-by-uid/)
$otpauthenticator = "true"; //Required
$uid = "uid"; //Required
$result = $multiFactorAuthenticationAPI->mfaResetSMSAuthenticatorByUid($otpauthenticator,$uid);
This API resets the Google Authenticator configurations on a given account via the UID. [More Info]( MFA Reset Google Authenticator By UID (DELETE)https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/google-authenticator/mfa-reset-google-authenticator-by-uid/)
$googleauthenticator = "true"; //Required
$uid = "uid"; //Required
$result = $multiFactorAuthenticationAPI->mfaResetGoogleAuthenticatorByUid($googleauthenticator,$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();
This API is used to reset pin using reset token. [More Info]( Reset PIN By ResetToken (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-resettoken/)
$payload = '{
"pin" : "<pin>",
"resetToken" : "<resetToken>"
}'; //Required
$result = $pinAuthenticationAPI->resetPINByResetToken($payload);
This API is used to reset pin using security question answer and email. [More Info]( Reset PIN By SecurityAnswer And Email (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-securityanswer-and-email/)
$payload = '{
"email" : "<email>",
"pin" : "<pin>",
"securityAnswer" : {"QuestionID":"Answer"}
}'; //Required
$result = $pinAuthenticationAPI->resetPINByEmailAndSecurityAnswer($payload);
This API is used to reset pin using security question answer and username. [More Info]( Reset PIN By SecurityAnswer And Username (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-securityanswer-and-username/)
$payload = '{
"pin" : "<pin>",
"securityAnswer" : {"QuestionID":"Answer"},
"username" : "<username>"
}'; //Required
$result = $pinAuthenticationAPI->resetPINByUsernameAndSecurityAnswer($payload);
This API is used to reset pin using security question answer and phone. [More Info]( Reset PIN By SecurityAnswer And Phone (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-securityanswer-and-phone/)
$payload = '{
"phone" : "<phone>",
"pin" : "<pin>",
"securityAnswer" : {"QuestionID":"Answer"}
}'; //Required
$result = $pinAuthenticationAPI->resetPINByPhoneAndSecurityAnswer($payload);
This API is used to change a user's PIN using access token. [More Info]( Change PIN By Token (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/change-pin-by-access-token/)
$access_token = "access_token"; //Required
$payload = '{
"newPIN" : "<newPIN>",
"oldPIN" : "<oldPIN>"
}'; //Required
$result = $pinAuthenticationAPI->changePINByAccessToken($access_token,$payload);
This API is used to reset pin using phoneId and OTP. [More Info]( Reset PIN by Phone and OTP (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-phone-and-otp/)
$payload = '{
"otp" : "<otp>",
"phone" : "<phone>",
"pin" : "<pin>"
}'; //Required
$result = $pinAuthenticationAPI->resetPINByPhoneAndOtp($payload);
This API is used to reset pin using email and OTP. [More Info]( Reset PIN by Email and OTP (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-email-and-otp/)
$payload = '{
"email" : "<email>",
"otp" : "<otp>",
"pin" : "<pin>"
}'; //Required
$result = $pinAuthenticationAPI->resetPINByEmailAndOtp($payload);
This API is used to reset pin using username and OTP. [More Info]( Reset PIN by Username and OTP (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-username-and-otp/)
$payload = '{
"otp" : "<otp>",
"pin" : "<pin>",
"username" : "<username>"
}'; //Required
$result = $pinAuthenticationAPI->resetPINByUsernameAndOtp($payload);
This API is used to login a user by pin and session token. [More Info]( PIN Login (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/login-by-pin/)
$payload = '{
"pin" : "<pin>"
}'; //Required
$session_token = "session_token"; //Required
$result = $pinAuthenticationAPI->pinLogin($payload,$session_token);
This API sends the reset pin email to specified email address. [More Info]( Forgot PIN By Email (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/forgot-pin-by-email/)
$payload = '{
"email" : "<email>"
}'; //Required
$emailTemplate = "emailTemplate"; //Optional
$resetPINUrl = "resetPINUrl"; //Optional
$result = $pinAuthenticationAPI->sendForgotPINEmailByEmail($payload,$emailTemplate,$resetPINUrl);
This API sends the reset pin email using username. [More Info]( Forgot PIN By UserName (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/forgot-pin-by-username/)
$payload = '{
"userName" : "<userName>"
}'; //Required
$emailTemplate = "emailTemplate"; //Optional
$resetPINUrl = "resetPINUrl"; //Optional
$result = $pinAuthenticationAPI->sendForgotPINEmailByUsername($payload,$emailTemplate,$resetPINUrl);
This API sends the OTP to specified phone number [More Info]( Forgot PIN By Phone (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/forgot-pin-by-phone/)
$payload = '{
"phone" : "<phone>"
}'; //Required
$smsTemplate = "smsTemplate"; //Optional
$result = $pinAuthenticationAPI->sendForgotPINSMSByPhone($payload,$smsTemplate);
This API is used to change a user's PIN using Pin Auth token. [More Info]( Set PIN By PinAuthToken (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/set-pin-by-pinauthtoken/)
$payload = '{
"pin" : "<pin>"
}'; //Required
$pinAuthToken = "pinAuthToken"; //Required
$result = $pinAuthenticationAPI->setPINByPinAuthToken($payload,$pinAuthToken);
This API is used to invalidate pin session token. [More Info]( Invalidate PIN Session Token (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/invalidate-pin-session-token/)
$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
POST : Verify Multifactor OTP Authentication
POST : Verify Multifactor Password Authentication
POST : Verify Multifactor PIN Authentication
GET : Multi Factor Re-Authenticate
If you have not already initialized the ReAuthentication object do so now
$reAuthenticationAPI = new ReAuthenticationAPI();
This API is used to re-authenticate via Multi-factor authentication by passing the One Time Password received via SMS [More Info]( Validate MFA by OTP (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/mfa/re-auth-by-otp/)
$access_token = "access_token"; //Required
$payload = '{
"otp" : "<otp>"
}'; //Required
$result = $reAuthenticationAPI->mfaReAuthenticateByOTP($access_token,$payload);
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]( Validate MFA by Backup Code (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/mfa/re-auth-by-backup-code/)
$access_token = "access_token"; //Required
$payload = '{
"backupCode" : "<backupCode>"
}'; //Required
$result = $reAuthenticationAPI->mfaReAuthenticateByBackupCode($access_token,$payload);
This API is used to re-authenticate via Multi-factor-authentication by passing the google authenticator code [More Info]( Validate MFA by Google Authenticator Code (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/re-auth-by-google-authenticator-code)
$access_token = "access_token"; //Required
$payload = '{
"googleAuthenticatorCode" : "<googleAuthenticatorCode>"
}'; //Required
$result = $reAuthenticationAPI->mfaReAuthenticateByGoogleAuth($access_token,$payload);
This API is used to re-authenticate via Multi-factor-authentication by passing the password [More Info]( Validate MFA by Password (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/re-auth-by-password)
$access_token = "access_token"; //Required
$payload = '{
"password" : "<password>"
}'; //Required
$smsTemplate2FA = "smsTemplate2FA"; //Optional
$result = $reAuthenticationAPI->mfaReAuthenticateByPassword($access_token,$payload,$smsTemplate2FA);
This API is used to validate the triggered MFA authentication flow with a password. [More Info]( MFA Re-authentication by PIN (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/pin/re-auth-by-pin/)
$access_token = "access_token"; //Required
$payload = '{
"pin" : "<pin>"
}'; //Required
$smsTemplate2FA = "smsTemplate2FA"; //Optional
$result = $reAuthenticationAPI->verifyPINAuthentication($access_token,$payload,$smsTemplate2FA);
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]( Verify Multifactor OTP Authentication (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/mfa/re-auth-validate-mfa/)
$payload = '{
"secondFactorValidationToken" : "<secondFactorValidationToken>"
}'; //Required
$uid = "uid"; //Required
$result = $reAuthenticationAPI->verifyMultiFactorOtpReauthentication($payload,$uid);
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]( Verify Multifactor Password Authentication (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/re-auth-validate-password/)
$payload = '{
"secondFactorValidationToken" : "<secondFactorValidationToken>"
}'; //Required
$uid = "uid"; //Required
$result = $reAuthenticationAPI->verifyMultiFactorPasswordReauthentication($payload,$uid);
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]( Verify Multifactor PIN Authentication (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/pin/re-auth-validate-pin/)
$payload = '{
"secondFactorValidationToken" : "<secondFactorValidationToken>"
}'; //Required
$uid = "uid"; //Required
$result = $reAuthenticationAPI->verifyMultiFactorPINReauthentication($payload,$uid);
This API is used to trigger the Multi-Factor Authentication workflow for the provided access token [More Info]( Multi Factor Re-Authenticate (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/re-auth-trigger/)
$access_token = "access_token"; //Required
$smsTemplate2FA = "smsTemplate2FA"; //Optional
$result = $reAuthenticationAPI->mfaReAuthenticate($access_token,$smsTemplate2FA);
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();
This API is to update consents using access token. [More Info]( Update Consent By Access Token (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/update-consent-by-access-token/)
$access_token = "access_token"; //Required
$payload = '{
"consents" : [ {
"consentOptionId" : "<consentOptionId>" ,
"isAccepted" : true
} ]
}'; //Required
$result = $consentManagementAPI->updateConsentProfileByAccessToken($access_token,$payload);
This API is to submit consent form using consent token. [More Info]( Consent By ConsentToken (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/consent-by-consent-token/)
$consentToken = "consentToken"; //Required
$payload = '{
"data" : [ {
"consentOptionId" : "<consentOptionId>" ,
"isAccepted" : true
} ] ,
"events" : [ {
"event" : "<event>" ,
"isCustom" : true
} ]
}'; //Required
$result = $consentManagementAPI->submitConsentByConsentToken($consentToken,$payload);
API to provide a way to end user to submit a consent form for particular event type. [More Info]( Post Consent By Access Token (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/consent-by-access-token/)
$access_token = "access_token"; //Required
$payload = '{
"data" : [ {
"consentOptionId" : "<consentOptionId>" ,
"isAccepted" : true
} ] ,
"events" : [ {
"event" : "<event>" ,
"isCustom" : true
} ]
}'; //Required
$result = $consentManagementAPI->submitConsentByAccessToken($access_token,$payload);
This API is used to get the Consent logs of the user. [More Info]( Get Consent Logs By Uid (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/consent-log-by-uid/)
$uid = "uid"; //Required
$result = $consentManagementAPI->getConsentLogsByUid($uid);
This API is used to fetch consent logs. [More Info]( Get Consent Log by Access Token (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/consent-log-by-access-token/)
$access_token = "access_token"; //Required
$result = $consentManagementAPI->getConsentLogs($access_token);
This API is used to check if consent is submitted for a particular event or not. [More Info]( Get Verify Consent By Access Token (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/verify-consent-by-access-token/)
$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();
This API verifies the provided token for Smart Login [More Info]( Smart Login Verify Token (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/smart-login/smart-login-verify-token/)
$verificationToken = "verificationToken"; //Required
$welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional
$result = $smartLoginAPI->smartLoginTokenVerification($verificationToken,$welcomeEmailTemplate);
This API sends a Smart Login link to the user's Email Id. [More Info]( Smart Login By Email (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/smart-login/smart-login-by-email)
$clientGuid = "clientGuid"; //Required
$email = "email"; //Required
$redirectUrl = "redirectUrl"; //Optional
$smartLoginEmailTemplate = "smartLoginEmailTemplate"; //Optional
$welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional
$result = $smartLoginAPI->smartLoginByEmail($clientGuid,$email,$redirectUrl,$smartLoginEmailTemplate,$welcomeEmailTemplate);
This API sends a Smart Login link to the user's Email Id. [More Info]( Smart Login By Username (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/smart-login/smart-login-by-username)
$clientGuid = "clientGuid"; //Required
$username = "username"; //Required
$redirectUrl = "redirectUrl"; //Optional
$smartLoginEmailTemplate = "smartLoginEmailTemplate"; //Optional
$welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional
$result = $smartLoginAPI->smartLoginByUserName($clientGuid,$username,$redirectUrl,$smartLoginEmailTemplate,$welcomeEmailTemplate);
This API is used to check if the Smart Login link has been clicked or not [More Info]( Smart Login Ping (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/smart-login/smart-login-ping)
$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();
This API is used to verify the otp for One Touch Login. [More Info]( One Touch OTP Verification (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/one-touch-login/one-touch-otp-verification/)
$otp = "otp"; //Required
$phone = "phone"; //Required
$fields = null; //Optional
$smsTemplate = "smsTemplate"; //Optional
$result = $oneTouchLoginAPI->oneTouchLoginOTPVerification($otp,$phone,$fields,$smsTemplate);
This API is used to send a link to a specified email for a frictionless login/registration [More Info]( One Touch Login by Email (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/one-touch-login/one-touch-login-by-email-captcha/)
$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);
This API is used to send one time password to a given phone number for a frictionless login/registration. [More Info]( One Touch Login by Phone (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/one-touch-login/one-touch-login-by-phone-captcha/)
$payload = '{
"g-recaptcha-response" : "<g-recaptcha-response>",
"phone" : "<phone>"
}'; //Required
$smsTemplate = "smsTemplate"; //Optional
$result = $oneTouchLoginAPI->oneTouchLoginByPhone($payload,$smsTemplate);
This API verifies the provided token for One Touch Login [More Info]( One Touch Email Verification (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/one-touch-login/one-touch-email-verification)
$verificationToken = "verificationToken"; //Required
$welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional
$result = $oneTouchLoginAPI->oneTouchEmailVerification($verificationToken,$welcomeEmailTemplate);
This API is used to check if the One Touch Login link has been clicked or not. [More Info]( One Touch Login Ping (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/one-touch-login/one-touch-login-ping/)
$clientGuid = "clientGuid"; //Required
$fields = null; //Optional
$result = $oneTouchLoginAPI->oneTouchLoginPing($clientGuid,$fields);
PasswordLessLogin API
List of APIs in this Section:
PUT : Passwordless Login Phone Verification
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();
This API verifies an account by OTP and allows the customer to login. [More Info]( Passwordless Login Phone Verification (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-phone-verification)
$payload = '{
"otp" : "<otp>",
"phone" : "<phone>"
}'; //Required
$fields = null; //Optional
$smsTemplate = "smsTemplate"; //Optional
$result = $passwordLessLoginAPI->passwordlessLoginPhoneVerification($payload,$fields,$smsTemplate);
API can be used to send a One-time Passcode (OTP) provided that the account has a verified PhoneID [More Info]( Passwordless Login by Phone (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-by-phone)
$phone = "phone"; //Required
$smsTemplate = "smsTemplate"; //Optional
$result = $passwordLessLoginAPI->passwordlessLoginByPhone($phone,$smsTemplate);
This API is used to send a Passwordless Login verification link to the provided Email ID [More Info]( Passwordless Login By Email (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-by-email)
$email = "email"; //Required
$passwordLessLoginTemplate = "passwordLessLoginTemplate"; //Optional
$verificationUrl = "verificationUrl"; //Optional
$result = $passwordLessLoginAPI->passwordlessLoginByEmail($email,$passwordLessLoginTemplate,$verificationUrl);
This API is used to send a Passwordless Login Verification Link to a customer by providing their UserName [More Info]( Passwordless Login By UserName (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-by-username)
$username = "username"; //Required
$passwordLessLoginTemplate = "passwordLessLoginTemplate"; //Optional
$verificationUrl = "verificationUrl"; //Optional
$result = $passwordLessLoginAPI->passwordlessLoginByUserName($username,$passwordLessLoginTemplate,$verificationUrl);
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]( Passwordless Login Verification (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-verification)
$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();
This API is used to get the configurations which are set in the LoginRadius Dashboard for a particular LoginRadius site/environment [More Info]( Get Configurations (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/configuration/get-configurations/) ``` $result = $configurationAPI->getConfigurations(); ```
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]( Get Server Time (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/configuration/get-server-time/)
$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();
This API is used to assign your desired roles to a given user. [More Info]( Assign Roles by UID (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/assign-roles-by-uid/)
$payload = '{
"roles" : [ "roles" ]
}'; //Required
$uid = "uid"; //Required
$result = $roleAPI->assignRolesByUid($payload,$uid);
This API creates a Context with a set of Roles [More Info]( Upsert Context (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/upsert-context)
$payload = '{
"roleContext" : [ {
"additionalPermissions" : ["<additionalPermissions>" ] ,
"context" : "<context>" ,
"expiration" : "<expiration>" ,
"roles" : ["<roles>" ]
} ]
}'; //Required
$uid = "uid"; //Required
$result = $roleAPI->updateRoleContextByUid($payload,$uid);
This API is used to add permissions to a given role. [More Info]( Add Permissions to Role (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/add-permissions-to-role)
$payload = '{
"permissions" : [ "permissions" ]
}'; //Required
$role = "role"; //Required
$result = $roleAPI->addRolePermissions($payload,$role);
This API creates a role with permissions. [More Info]( Roles Create (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/roles-create)
$payload = '{
"roles" : [ {
"name" : "<name>" ,
"permissions" : {"Permission_name":true}
} ]
}'; //Required
$result = $roleAPI->createRoles($payload);
API is used to retrieve all the assigned roles of a particular User. [More Info]( Roles by UID (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/get-roles-by-uid)
$uid = "uid"; //Required
$result = $roleAPI->getRolesByUid($uid);
This API Gets the contexts that have been configured and the associated roles and permissions. [More Info]( Get Context with Roles and Permissions (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/get-context)
$uid = "uid"; //Required
$result = $roleAPI->getRoleContextByUid($uid);
The API is used to retrieve role context by the context name. [More Info]( Role Context profile (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/role-context-profile/)
$contextName = "contextName"; //Required
$result = $roleAPI->getRoleContextByContextName($contextName);
This API retrieves the complete list of created roles with permissions of your app. [More Info]( Roles List (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/roles-list)
$result = $roleAPI->getRolesList();
This API is used to unassign roles from a user. [More Info]( Unassign Roles by UID (DELETE)https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/unassign-roles-by-uid)
$payload = '{
"roles" : [ "roles" ]
}'; //Required
$uid = "uid"; //Required
$result = $roleAPI->unassignRolesByUid($payload,$uid);
This API Deletes the specified Role Context [More Info]( Delete Role Context (DELETE)https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/delete-context)
$contextName = "contextName"; //Required
$uid = "uid"; //Required
$result = $roleAPI->deleteRoleContextByUid($contextName,$uid);
This API Deletes the specified Role from a Context. [More Info]( Delete Role from Context (DELETE)https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/delete-role-from-context/)
$contextName = "contextName"; //Required
$payload = '{
"roles" : [ "roles" ]
}'; //Required
$uid = "uid"; //Required
$result = $roleAPI->deleteRolesFromRoleContextByUid($contextName,$payload,$uid);
This API Deletes Additional Permissions from Context. [More Info]( Delete Additional Permission from Context (DELETE)https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/delete-permissions-from-context)
$contextName = "contextName"; //Required
$payload = '{
"additionalPermissions" : [ "additionalPermissions" ]
}'; //Required
$uid = "uid"; //Required
$result = $roleAPI->deleteAdditionalPermissionFromRoleContextByUid($contextName,$payload,$uid);
This API is used to delete the role. [More Info]( Account Delete Role (DELETE)https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/delete-role)
$role = "role"; //Required
$result = $roleAPI->deleteRole($role);
API is used to remove permissions from a role. [More Info]( Remove Permissions (DELETE)https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/remove-permissions)
$payload = '{
"permissions" : [ "permissions" ]
}'; //Required
$role = "role"; //Required
$result = $roleAPI->removeRolePermissions($payload,$role);
CustomRegistrationData API
List of APIs in this Section:
PUT : Update Registration Data
POST : Validate secret code
POST : Add Registration Data
GET : Auth Get Registration Data Server
GET : Get Registration Data
DELETE : Delete Registration Data
DELETE : Delete All Records by Datasource
If you have not already initialized the CustomRegistrationData object do so now
$customRegistrationDataAPI = new CustomRegistrationDataAPI();
This API allows you to update a dropdown item [More Info]( Update Registration Data (PUT)https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-registration-data/update-registration-data)
$payload = '{
"isActive" : true,
"key" : "<key>",
"type" : "<type>",
"value" : "<value>"
}'; //Required
$recordId = "recordId"; //Required
$result = $customRegistrationDataAPI->updateRegistrationData($payload,$recordId);
This API allows you to validate code for a particular dropdown member. [More Info]( Validate secret code (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-registration-data/validate-code)
$code = "code"; //Required
$recordId = "recordId"; //Required
$result = $customRegistrationDataAPI->validateRegistrationDataCode($code,$recordId);
This API allows you to fill data into a dropdown list which you have created for user Registration. For more details on how to use this API please see our Custom Registration Data Overview [More Info]( Add Registration Data (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-registration-data/add-registration-data)
$payload = '{
"data" : [ {
"code" : "<code>" ,
"isActive" : true ,
"key" : "<key>" ,
"parentId" : "<parentId>" ,
"type" : "<type>" ,
"value" : "<value>"
} ]
}'; //Required
$result = $customRegistrationDataAPI->addRegistrationData($payload);
This API is used to retrieve dropdown data. [More Info]( Auth Get Registration Data Server (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-registration-data/auth-get-registration-data)
$type = "type"; //Required
$limit = 0; //Optional
$parentId = "parentId"; //Optional
$skip = 0; //Optional
$result = $customRegistrationDataAPI->authGetRegistrationData($type,$limit,$parentId,$skip);
This API is used to retrieve dropdown data. [More Info]( Get Registration Data (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-registration-data/get-registration-data)
$type = "type"; //Required
$limit = 0; //Optional
$parentId = "parentId"; //Optional
$skip = 0; //Optional
$result = $customRegistrationDataAPI->getRegistrationData($type,$limit,$parentId,$skip);
This API allows you to delete an item from a dropdown list. [More Info]( Delete Registration Data (DELETE)https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-registration-data/delete-registration-data)
$recordId = "recordId"; //Required
$result = $customRegistrationDataAPI->deleteRegistrationData($recordId);
This API allows you to delete all records contained in a datasource. [More Info]( Delete All Records by Datasource (DELETE)https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-registration-data/delete-all-records-by-datasource)
$type = "type"; //Required
$result = $customRegistrationDataAPI->deleteAllRecordsByDataSource($type);
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();
This API retrieves a copy of the user data based on the Email [More Info]( Risk Based Authentication Login by Email (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-login-by-email)
$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);
This API retrieves a copy of the user data based on the Username [More Info]( Risk Based Authentication Login by Username (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-login-by-username)
$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);
This API retrieves a copy of the user data based on the Phone [More Info]( Risk Based Authentication Phone Login (POST)https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-login)
$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();
This API allows you to generate SOTT with a given expiration time. [More Info]( Generate SOTT (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/session/generate-sott-token)
$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 Vkontakte Token
GET : Access Token via Google AuthCode
If you have not already initialized the NativeSocial object do so now
$nativeSocialAPI = new NativeSocialAPI();
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]( Access Token via Facebook Token (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-facebook-token/)
$fb_Access_Token = "fb_Access_Token"; //Required
$socialAppName = "socialAppName"; //Optional
$result = $nativeSocialAPI->getAccessTokenByFacebookAccessToken($fb_Access_Token,$socialAppName);
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]( Access Token via Twitter Token (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-twitter-token)
$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);
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]( Access Token via Google Token (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-google-token)
$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);
This API is used to Get LoginRadius Access Token using google jwt id token for google native mobile login/registration. [More Info]( Access Token using google JWT token for Native Mobile Login (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-googlejwt)
$id_Token = "id_Token"; //Required
$result = $nativeSocialAPI->getAccessTokenByGoogleJWTAccessToken($id_Token);
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]( Access Token via Linkedin Token (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-linkedin-token/)
$ln_Access_Token = "ln_Access_Token"; //Required
$socialAppName = "socialAppName"; //Optional
$result = $nativeSocialAPI->getAccessTokenByLinkedinAccessToken($ln_Access_Token,$socialAppName);
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]( Get Access Token By Foursquare Access Token (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-foursquare-token/)
$fs_Access_Token = "fs_Access_Token"; //Required
$result = $nativeSocialAPI->getAccessTokenByFoursquareAccessToken($fs_Access_Token);
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]( Access Token via Apple Id Code (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-apple-id-code)
$code = "code"; //Required
$socialAppName = "socialAppName"; //Optional
$result = $nativeSocialAPI->getAccessTokenByAppleIdCode($code,$socialAppName);
This API is used to retrieve a LoginRadius access token by passing in a valid WeChat OAuth Code. [More Info]( Access Token via WeChat Code (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-wechat-code)
$code = "code"; //Required
$result = $nativeSocialAPI->getAccessTokenByWeChatCode($code);
The API is used to get LoginRadius access token by sending Vkontakte's access token. It will be valid for the specific duration of time specified in the response. [More Info]( Access Token via Vkontakte Token (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-vkontakte-token)
$vk_access_token = "vk_access_token"; //Required
$result = $nativeSocialAPI->getAccessTokenByVkontakteAccessToken($vk_access_token);
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]( Access Token via Google AuthCode (GET)https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-google-auth-code)
$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();
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]( Webhook Subscribe (POST)https://www.loginradius.com/docs/api/v2/integrations/webhooks/webhook-subscribe)
$payload = '{
"event" : "<event>",
"targetUrl" : "<targetUrl>"
}'; //Required
$result = $webHookAPI->webHookSubscribe($payload);
This API is used to fetch all the subscribed URLs, for particular event [More Info]( Webhook Subscribed URLs (GET)https://www.loginradius.com/docs/api/v2/integrations/webhooks/webhook-subscribed-urls)
$event = "event"; //Required
$result = $webHookAPI->getWebHookSubscribedURLs($event);
API can be used to test a subscribed WebHook. [More Info]( Webhook Test (GET)https://www.loginradius.com/docs/api/v2/integrations/webhooks/webhook-test)
$result = $webHookAPI->webhookTest();
API can be used to unsubscribe a WebHook configured on your LoginRadius site. [More Info]( WebHook Unsubscribe (DELETE)https://www.loginradius.com/docs/api/v2/integrations/webhooks/webhook-unsubscribe)
$payload = '{
"event" : "<event>",
"targetUrl" : "<targetUrl>"
}'; //Required
$result = $webHookAPI->webHookUnsubscribe($payload);
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