An open API service indexing awesome lists of open source software.

https://github.com/loginradius/php-sdk

The LoginRadius PHP library will let you integrate LoginRadius' customer identity platform with your PHP application(s).
https://github.com/loginradius/php-sdk

ciam hacktoberfest hacktoberfest2020 loginradius loginradius-sdk php profile-data user-profile

Last synced: about 1 year ago
JSON representation

The LoginRadius PHP library will let you integrate LoginRadius' customer identity platform with your PHP application(s).

Awesome Lists containing this project

README

          

LoginRadius
==========

![Home Image](http://docs.lrcontent.com/resources/github/banner-1544x500.png)

-----------------------------------------------
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](http://getcomposer.org/).

### 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.7.0
```

Include the following files in your Project Directory

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

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

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

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

require_once "src/LoginRadiusSDK/CustomerRegistration/Social/NativeSocialAPI.php";
require_once "src/LoginRadiusSDK/CustomerRegistration/Social/SocialAPI.php";
require_once "../../src/LoginRadiusSDK/CustomerRegistration/Authentication/SlidingTokenAPI.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:
```php
define('APP_NAME', 'LOGINRADIUS_SITE_NAME_HERE'); // Replace LOGINRADIUS_SITE_NAME_HERE with your site name that provide in LoginRadius account.
define('LR_API_KEY', 'LOGINRADIUS_API_KEY_HERE'); // Replace LOGINRADIUS_API_KEY_HERE with your site API key that provide in LoginRadius account.
define('LR_API_SECRET', 'LOGINRADIUS_API_SECRET_HERE'); // Replace LOGINRADIUS_API_SECRET_HERE with your site Secret key that provide in LoginRadius account.

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

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

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

```

>Replace 'LOGINRADIUS_SITE_NAME_HERE', 'LOGINRADIUS_API_KEY_HERE' and 'LOGINRADIUS_API_SECRET_HERE' in the above code with your LoginRadius Site Name, LoginRadius API Key, and Secret.This information can be found in your LoginRadius account as described [here](https://www.loginradius.com/docs/api/v2/admin-console/platform-security/api-key-and-secret).

>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.

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

```

Create a LoginRadius object :
```php
$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:**

```php

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

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

```

**Output Response:**

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

```

### Authentication API

List of APIs in this Section:

[PUT : Auth Update Profile by Token](#UpdateProfileByAccessToken-put-)

[PUT : Auth Unlock Account by Access Token](#UnlockAccountByToken-put-)

[PUT : Auth Verify Email By OTP](#VerifyEmailByOTP-put-)

[PUT : Auth Reset Password by Security Answer and Email](#ResetPasswordBySecurityAnswerAndEmail-put-)

[PUT : Auth Reset Password by Security Answer and Phone](#ResetPasswordBySecurityAnswerAndPhone-put-)

[PUT : Auth Reset Password by Security Answer and UserName](#ResetPasswordBySecurityAnswerAndUserName-put-)

[PUT : Auth Reset Password by Reset Token](#ResetPasswordByResetToken-put-)

[PUT : Auth Reset Password by OTP](#ResetPasswordByEmailOTP-put-)

[PUT : Auth Reset Password by OTP and UserName](#ResetPasswordByOTPAndUserName-put-)

[PUT : Auth Change Password](#ChangePassword-put-)

[PUT : Auth Set or Change UserName](#SetOrChangeUserName-put-)

[PUT : Auth Resend Email Verification](#AuthResendEmailVerification-put-)

[POST : Auth Add Email](#AddEmail-post-)

[POST : Auth Login by Email](#LoginByEmail-post-)

[POST : Auth Login by Username](#LoginByUserName-post-)

[POST : Auth Forgot Password](#ForgotPassword-post-)

[POST : Auth Link Social Identities](#LinkSocialIdentities-post-)

[POST : Auth Link Social Identities By Ping](#LinkSocialIdentitiesByPing-post-)

[POST : Auth User Registration by Email](#UserRegistrationByEmail-post-)

[POST : Auth User Registration By Captcha](#UserRegistrationByCaptcha-post-)

[GET : Get Security Questions By Email](#GetSecurityQuestionsByEmail-get-)

[GET : Get Security Questions By UserName](#GetSecurityQuestionsByUserName-get-)

[GET : Get Security Questions By Phone](#GetSecurityQuestionsByPhone-get-)

[GET : Get Security Questions By Access Token](#GetSecurityQuestionsByAccessToken-get-)

[GET : Auth Validate Access token](#AuthValidateAccessToken-get-)

[GET : Access Token Invalidate](#AuthInValidateAccessToken-get-)

[GET : Access Token Info](#GetAccessTokenInfo-get-)

[GET : Auth Read all Profiles by Token](#GetProfileByAccessToken-get-)

[GET : Auth Send Welcome Email](#SendWelcomeEmail-get-)

[GET : Auth Delete Account](#DeleteAccountByDeleteToken-get-)

[GET : Get Profile By Ping](#GetProfileByPing-get-)

[GET : Auth Check Email Availability](#CheckEmailAvailability-get-)

[GET : Auth Verify Email](#VerifyEmail-get-)

[GET : Auth Check UserName Availability](#CheckUserNameAvailability-get-)

[GET : Auth Privacy Policy Accept](#AcceptPrivacyPolicy-get-)

[GET : Auth Privacy Policy History By Access Token](#GetPrivacyPolicyHistoryByAccessToken-get-)

[GET : Auth send verification Email for linking social profiles](#AuthSendVerificationEmailForLinkingSocialProfiles-get-)

[DELETE : Auth Delete Account with Email Confirmation](#DeleteAccountWithEmailConfirmation-delete-)

[DELETE : Auth Remove Email](#RemoveEmail-delete-)

[DELETE : Auth Unlink Social Identities](#UnlinkSocialIdentities-delete-)

If you have not already initialized the Authentication object do so now
```php
$authenticationAPI = new AuthenticationAPI();
```

Auth Update Profile by Token (PUT)

This API is used to update the user's profile by passing the access token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-update-profile-by-token/)

```php

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

$result = $authenticationAPI->updateProfileByAccessToken($access_token,$payload,$emailTemplate,$fields,$nullSupport,$smsTemplate,$verificationUrl,$isVoiceOtp,$options);
```


Auth Unlock Account by Access Token (PUT)

This API is used to allow a customer with a valid access token to unlock their account provided that they successfully pass the prompted Bot Protection challenges. The Block or Suspend block types are not applicable for this API. For additional details see our Auth Security Configuration documentation.You are only required to pass the Post Parameters that correspond to the prompted challenges. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-unlock-account-by-access-token/)

```php

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

$result = $authenticationAPI->unlockAccountByToken($access_token,$payload);
```


Auth Verify Email By OTP (PUT)


This API is used to verify the email of user when the OTP Email verification flow is enabled, please note that you must contact LoginRadius to have this feature enabled.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-verify-email-by-otp/)

```php

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

$result = $authenticationAPI->verifyEmailByOTP($payload,$fields,$url,$welcomeEmailTemplate);
```


Auth Reset Password by Security Answer and Email (PUT)

This API is used to reset password for the specified account by security question
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-email)

```php

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

$result = $authenticationAPI->resetPasswordBySecurityAnswerAndEmail($payload);
```


Auth Reset Password by Security Answer and Phone (PUT)

This API is used to reset password for the specified account by security question
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-phone)

```php

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

$result = $authenticationAPI->resetPasswordBySecurityAnswerAndPhone($payload);
```


Auth Reset Password by Security Answer and UserName (PUT)

This API is used to reset password for the specified account by security question
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-username)

```php

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

$result = $authenticationAPI->resetPasswordBySecurityAnswerAndUserName($payload);
```


Auth Reset Password by Reset Token (PUT)

This API is used to set a new password for the specified account.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-reset-token)

```php

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

$result = $authenticationAPI->resetPasswordByResetToken($payload);
```


Auth Reset Password by OTP (PUT)

This API is used to set a new password for the specified account.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-otp)

```php

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

$result = $authenticationAPI->resetPasswordByEmailOTP($payload);
```


Auth Reset Password by OTP and UserName (PUT)

This API is used to set a new password for the specified account if you are using the username as the unique identifier in your workflow
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-otp-and-username/)

```php

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

$result = $authenticationAPI->resetPasswordByOTPAndUserName($payload);
```


Auth Change Password (PUT)

This API is used to change the accounts password based on the previous password
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-change-password)

```php

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

$result = $authenticationAPI->changePassword($access_token,$newPassword,$oldPassword);
```


Auth Set or Change UserName (PUT)

This API is used to set or change UserName by access token.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-set-or-change-user-name/)

```php

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

$result = $authenticationAPI->setOrChangeUserName($access_token,$username);
```


Auth Resend Email Verification (PUT)

This API resends the verification email to the user.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-resend-email-verification/)

```php

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

$result = $authenticationAPI->authResendEmailVerification($email,$emailTemplate,$verificationUrl);
```


Auth Add Email (POST)

This API is used to add additional emails to a user's account.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-add-email)

```php

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

$result = $authenticationAPI->addEmail($access_token,$email,$type,$emailTemplate,$verificationUrl);
```


Auth Login by Email (POST)

This API retrieves a copy of the user data based on the Email
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-login-by-email)

```php

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

$result = $authenticationAPI->loginByEmail($payload,$emailTemplate,$fields,$loginUrl,$verificationUrl);
```


Auth Login by Username (POST)

This API retrieves a copy of the user data based on the Username
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-login-by-username)

```php

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

$result = $authenticationAPI->loginByUserName($payload,$emailTemplate,$fields,$loginUrl,$verificationUrl);
```


Auth Forgot Password (POST)

This API is used to send the reset password url to a specified account. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username'
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-forgot-password)

```php

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

$result = $authenticationAPI->forgotPassword($email,$resetPasswordUrl,$emailTemplate);
```


Auth Link Social Identities (POST)

This API is used to link up a social provider account with an existing LoginRadius account on the basis of access token and the social providers user access token.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-link-social-identities)

```php

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

$result = $authenticationAPI->linkSocialIdentities($access_token,$candidateToken);
```


Auth Link Social Identities By Ping (POST)

This API is used to link up a social provider account with an existing LoginRadius account on the basis of ping and the social providers user access token.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-link-social-identities-by-ping)

```php

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

$result = $authenticationAPI->linkSocialIdentitiesByPing($access_token,$clientGuid);
```


Auth User Registration by Email (POST)

This API creates a user in the database as well as sends a verification email to the user.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-user-registration-by-email)

```php

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

$result = $authenticationAPI->userRegistrationByEmail($payload,$sott,$emailTemplate,$fields,$options,$verificationUrl,$welcomeEmailTemplate,$isVoiceOtp);
```


Auth User Registration By Captcha (POST)

This API creates a user in the database as well as sends a verification email to the user.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-user-registration-by-recaptcha)

```php

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

$result = $authenticationAPI->userRegistrationByCaptcha($payload,$emailTemplate,$fields,$options,$smsTemplate,$verificationUrl,$welcomeEmailTemplate,$isVoiceOtp);
```


Get Security Questions By Email (GET)

This API is used to retrieve the list of questions that are configured on the respective LoginRadius site.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-email/)

```php

$email = "email"; //Required

$result = $authenticationAPI->getSecurityQuestionsByEmail($email);
```


Get Security Questions By UserName (GET)

This API is used to retrieve the list of questions that are configured on the respective LoginRadius site.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-user-name/)

```php

$userName = "userName"; //Required

$result = $authenticationAPI->getSecurityQuestionsByUserName($userName);
```


Get Security Questions By Phone (GET)

This API is used to retrieve the list of questions that are configured on the respective LoginRadius site.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-phone/)

```php

$phone = "phone"; //Required

$result = $authenticationAPI->getSecurityQuestionsByPhone($phone);
```


Get Security Questions By Access Token (GET)

This API is used to retrieve the list of questions that are configured on the respective LoginRadius site.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-access-token/)

```php

$access_token = "access_token"; //Required

$result = $authenticationAPI->getSecurityQuestionsByAccessToken($access_token);
```


Auth Validate Access token (GET)

This api validates access token, if valid then returns a response with its expiry otherwise error.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-validate-access-token/)

```php

$access_token = "access_token"; //Required

$result = $authenticationAPI->authValidateAccessToken($access_token);
```


Access Token Invalidate (GET)

This api call invalidates the active access token or expires an access token's validity.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-invalidate-access-token/)

```php

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

$result = $authenticationAPI->authInValidateAccessToken($access_token,$preventRefresh);
```


Access Token Info (GET)

This api call provide the active access token Information
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-access-token-info/)

```php

$access_token = "access_token"; //Required

$result = $authenticationAPI->getAccessTokenInfo($access_token);
```


Auth Read all Profiles by Token (GET)

This API retrieves a copy of the user data based on the access token.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-read-profiles-by-token/)

```php

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

$result = $authenticationAPI->getProfileByAccessToken($access_token,$fields,$emailTemplate,$verificationUrl,$welcomeEmailTemplate);
```


Auth Send Welcome Email (GET)

This API sends a welcome email
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-send-welcome-email/)

```php

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

$result = $authenticationAPI->sendWelcomeEmail($access_token,$welcomeEmailTemplate);
```


Auth Delete Account (GET)

This API is used to delete an account by passing it a delete token.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-delete-account/)

```php

$deletetoken = "deletetoken"; //Required

$result = $authenticationAPI->deleteAccountByDeleteToken($deletetoken);
```

Get Profile By Ping (GET)

This API is used to get a user's profile using the clientGuid parameter if no callback feature enabled.[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/social-login-by-ping/)

```php

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

$result = $authenticationAPI->getProfileByPing($clientGuid,$emailTemplate,$fields,$verificationUrl,$welcomeEmailTemplate);
```

Auth Check Email Availability (GET)

This API is used to check the email exists or not on your site.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-email-availability/)

```php

$email = "email"; //Required

$result = $authenticationAPI->checkEmailAvailability($email);
```


Auth Verify Email (GET)

This API is used to verify the email of user. Note: This API will only return the full profile if you have 'Enable auto login after email verification' set in your LoginRadius Admin Console's Email Workflow settings under 'Verification Email'.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-verify-email/)

```php

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

$result = $authenticationAPI->verifyEmail($verificationToken,$fields,$url,$welcomeEmailTemplate,$uuid);
```


Auth Check UserName Availability (GET)

This API is used to check the UserName exists or not on your site.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-username-availability/)

```php

$username = "username"; //Required

$result = $authenticationAPI->checkUserNameAvailability($username);
```


Auth Privacy Policy Accept (GET)

This API is used to update the privacy policy stored in the user's profile by providing the access token of the user accepting the privacy policy
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-privacy-policy-accept)

```php

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

$result = $authenticationAPI->acceptPrivacyPolicy($access_token,$fields);
```

Auth send verification Email for linking social profiles (GET)

This API is used to Send verification email to the unverified email of the social profile. This API can be used only incase of optional verification workflow. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-send-verification-for-social-email/)

```php

$access_token = "access_token"; //Required
$clientguid = "clientguid"; //Required

$result = $authenticationAPI->authSendVerificationEmailForLinkingSocialProfiles($access_token,$clientguid);
```


Auth Privacy Policy History By Access Token (GET)

This API will return all the accepted privacy policies for the user by providing the access token of that user.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/privacy-policy-history-by-access-token/)

```php

$access_token = "access_token"; //Required

$result = $authenticationAPI->getPrivacyPolicyHistoryByAccessToken($access_token);
```


Auth Delete Account with Email Confirmation (DELETE)

This API will send a confirmation email for account deletion to the customer's email when passed the customer's access token
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-delete-account-with-email-confirmation/)

```php

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

$result = $authenticationAPI->deleteAccountWithEmailConfirmation($access_token,$deleteUrl,$emailTemplate);
```


Auth Remove Email (DELETE)

This API is used to remove additional emails from a user's account.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-remove-email)

```php

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

$result = $authenticationAPI->removeEmail($access_token,$email);
```


Auth Unlink Social Identities (DELETE)

This API is used to unlink up a social provider account with the specified account based on the access token and the social providers user access token. The unlinked account will automatically get removed from your database.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-unlink-social-identities)

```php

$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](#UpdateAccountByUid-put-)

[PUT : Update Phone ID by UID](#UpdatePhoneIDByUid-put-)

[PUT : Account Set Password](#SetAccountPasswordByUid-put-)

[PUT : Account Invalidate Verification Email](#InvalidateAccountEmailVerification-put-)

[PUT : Reset phone ID verification](#ResetPhoneIDVerificationByUid-put-)

[PUT : Upsert Email](#UpsertEmail-put-)

[PUT : Update UID](#AccountUpdateUid-put-)

[POST : Account Create](#CreateAccount-post-)

[POST : Forgot Password token](#GetForgotPasswordToken-post-)

[POST : Email Verification token](#GetEmailVerificationToken-post-)

[POST : Multipurpose Email Token Generation API](#MultipurposeEmailTokenGeneration-post-)

[POST : Multipurpose SMS OTP Generation API](#MultipurposeSMSOTPGeneration-post-)

[GET : Get Privacy Policy History By Uid](#GetPrivacyPolicyHistoryByUid-get-)

[GET : Account Profiles by Email](#GetAccountProfileByEmail-get-)

[GET : Account Profiles by Username](#GetAccountProfileByUserName-get-)

[GET : Account Profile by Phone ID](#GetAccountProfileByPhone-get-)

[GET : Account Profiles by UID](#GetAccountProfileByUid-get-)

[GET : Account Password](#GetAccountPasswordHashByUid-get-)

[GET : Access Token based on UID or User impersonation API](#GetAccessTokenByUid-get-)

[GET : Refresh Access Token by Refresh Token](#RefreshAccessTokenByRefreshToken-get-)

[GET : Revoke Refresh Token](#RevokeRefreshToken-get-)

[GET : Account Identities by Email](#GetAccountIdentitiesByEmail-get-)

[DELETE : Account Delete](#DeleteAccountByUid-delete-)

[DELETE : Account Remove Email](#RemoveEmail-delete-)

[DELETE : Revoke All Refresh Token](#RevokeAllRefreshToken-delete-)

[DELETE : Delete User Profiles By Email](#AccountDeleteByEmail-delete-)

If you have not already initialized the Account object do so now
```php
$accountAPI = new AccountAPI();
```

Account Update (PUT)

This API is used to update the information of existing accounts in your Cloud Storage. See our Advanced API Usage section Here for more capabilities.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-update)

```php

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

$result = $accountAPI->updateAccountByUid($payload,$uid,$fields,$nullSupport);
```


Update Phone ID by UID (PUT)

This API is used to update the PhoneId by using the Uid's. Admin can update the PhoneId's for both the verified and unverified profiles. It will directly replace the PhoneId and bypass the OTP verification process.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/update-phoneid-by-uid)

```php

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

$result = $accountAPI->updatePhoneIDByUid($phone,$uid,$fields);
```


Account Set Password (PUT)

This API is used to set the password of an account in Cloud Storage.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-set-password)

```php

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

$result = $accountAPI->setAccountPasswordByUid($password,$uid);
```


Account Invalidate Verification Email (PUT)

This API is used to invalidate the Email Verification status on an account.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-invalidate-verification-email)

```php

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

$result = $accountAPI->invalidateAccountEmailVerification($uid,$emailTemplate,$verificationUrl);
```


Reset phone ID verification (PUT)

This API Allows you to reset the phone no verification of an end user’s account.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/reset-phone-id-verification)

```php

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

$result = $accountAPI->resetPhoneIDVerificationByUid($uid,$smsTemplate,$isVoiceOtp);
```


Upsert Email (PUT)

This API is used to add/upsert another emails in account profile by different-different email types. If the email type is same then it will simply update the existing email, otherwise it will add a new email in Email array.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/upsert-email)

```php

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

$result = $accountAPI->upsertEmail($payload,$uid,$fields);
```


Update UID (PUT)

This API is used to update a user's Uid. It will update all profiles, custom objects and consent management logs associated with the Uid.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-update/)

```php

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

$result = $accountAPI->accountUpdateUid($payload,$uid);
```


Account Create (POST)

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

In order to use this API, you need to format a JSON request body with all of the mandatory fields
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-create)

```php

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

$result = $accountAPI->createAccount($payload,$fields);
```


Forgot Password token (POST)

This API Returns a Forgot Password Token it can also be used to send a Forgot Password email to the customer. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username' in the body.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/get-forgot-password-token)

```php

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

$result = $accountAPI->getForgotPasswordToken($email,$emailTemplate,$resetPasswordUrl,$sendEmail);
```


Email Verification token (POST)

This API Returns an Email Verification token.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/get-email-verification-token)

```php

$email = "email"; //Required

$result = $accountAPI->getEmailVerificationToken($email);
```

Multipurpose Email Token Generation API (POST)

This API generate Email tokens and Email OTPs for Email verification, Add email, Forgot password, Delete user, Passwordless login, Forgot pin, One-touch login and Auto login. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/multipurpose-token-and-sms-otp-generation-api/multipurpose-email-token-generation/)

```php

$payload = '{
"clientguid" : "",
"email" : "",
"name" : "",
"type" : "",
"uid" : "",
"userName" : ""
}'; //Required
$tokentype = "tokentype"; //Required

$result = $accountAPI->multipurposeEmailTokenGeneration($payload,$tokentype);
```


Multipurpose SMS OTP Generation API (POST)

This API generates SMS OTP for Add phone, Phone Id verification, Forgot password, Forgot pin, One-touch login, smart login and Passwordless login. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/multipurpose-token-and-sms-otp-generation-api/multipurpose-sms-otp-generation/)

```php

$payload = '{
"name" : "",
"phone" : "",
"uid" : ""
}'; //Required
$smsotptype = "smsotptype"; //Required

$result = $accountAPI->multipurposeSMSOTPGeneration($payload,$smsotptype);
```

Get Privacy Policy History By Uid (GET)

This API is used to retrieve all of the accepted Policies by the user, associated with their UID.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/privacy-policy-history-by-uid/)

```php

$uid = "uid"; //Required

$result = $accountAPI->getPrivacyPolicyHistoryByUid($uid);
```


Account Profiles by Email (GET)

This API is used to retrieve all of the profile data, associated with the specified account by email in Cloud Storage.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-email)

```php

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

$result = $accountAPI->getAccountProfileByEmail($email,$fields);
```


Account Profiles by Username (GET)

This API is used to retrieve all of the profile data associated with the specified account by user name in Cloud Storage.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-user-name)

```php

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

$result = $accountAPI->getAccountProfileByUserName($userName,$fields);
```


Account Profile by Phone ID (GET)

This API is used to retrieve all of the profile data, associated with the account by phone number in Cloud Storage.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-phone-id/)

```php

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

$result = $accountAPI->getAccountProfileByPhone($phone,$fields);
```


Account Profiles by UID (GET)

This API is used to retrieve all of the profile data, associated with the account by uid in Cloud Storage.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-uid)

```php

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

$result = $accountAPI->getAccountProfileByUid($uid,$fields);
```


Account Password (GET)

This API use to retrive the hashed password of a specified account in Cloud Storage.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-password)

```php

$uid = "uid"; //Required

$result = $accountAPI->getAccountPasswordHashByUid($uid);
```


Access Token based on UID or User impersonation API (GET)

The API is used to get LoginRadius access token based on UID.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-impersonation-api)

```php

$uid = "uid"; //Required

$result = $accountAPI->getAccessTokenByUid($uid);
```


Refresh Access Token by Refresh Token (GET)

This API is used to refresh an access token via it's associated refresh token.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/refresh-access-token-by-refresh-token)

```php

$refresh_Token = "refresh_Token"; //Required

$result = $accountAPI->refreshAccessTokenByRefreshToken($refresh_Token);
```


Revoke Refresh Token (GET)

The Revoke Refresh Access Token API is used to revoke a refresh token or the Provider Access Token, revoking an existing refresh token will invalidate the refresh token but the associated access token will work until the expiry.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/revoke-refresh-token)

```php

$refresh_Token = "refresh_Token"; //Required

$result = $accountAPI->revokeRefreshToken($refresh_Token);
```


Account Identities by Email (GET)

Note: This is intended for specific workflows where an email may be associated to multiple UIDs. This API is used to retrieve all of the identities (UID and Profiles), associated with a specified email in Cloud Storage.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-identities-by-email)

```php

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

$result = $accountAPI->getAccountIdentitiesByEmail($email,$fields);
```


Account Delete (DELETE)

This API deletes the Users account and allows them to re-register for a new account.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-delete)

```php

$uid = "uid"; //Required

$result = $accountAPI->deleteAccountByUid($uid);
```


Account Remove Email (DELETE)

Use this API to Remove emails from a user Account
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-email-delete)

```php

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

$result = $accountAPI->removeEmail($email,$uid,$fields);
```

Revoke All Refresh Token (DELETE)

The Revoke All Refresh Access Token API is used to revoke all refresh tokens for a specific user. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/revoke-all-refresh-token/)

```php

$uid = "uid"; //Required

$result = $accountAPI->revokeAllRefreshToken($uid);
```


Delete User Profiles By Email (DELETE)

This API is used to delete all user profiles associated with an Email.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-email-delete/)

```php

$email = "email"; //Required

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

### Social API

List of APIs in this Section:

[GET : Access Token](#ExchangeAccessToken-get-)

[GET : Refresh Token](#RefreshAccessToken-get-)

[GET : Token Validate](#ValidateAccessToken-get-)

[GET : Access Token Invalidate](#InValidateAccessToken-get-)

[GET : Get Active Session Details](#GetActiveSession-get-)

[GET : Get Active Session By Account Id](#GetActiveSessionByAccountID-get-)

[GET : Get Active Session By Profile Id](#GetActiveSessionByProfileID-get-)

If you have not already initialized the Social object do so now
```php
$socialAPI = new SocialAPI();
```


Access Token (GET)

This API Is used to translate the Request Token returned during authentication into an Access Token that can be used with other API calls.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/access-token)

```php

$token = "token"; //Required

$result = $socialAPI->exchangeAccessToken($token);
```


Refresh Token (GET)

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

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

Contact LoginRadius support team to enable this API.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/refresh-token)

```php

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

$result = $socialAPI->refreshAccessToken($access_Token,$expiresIn,$isWeb);
```


Token Validate (GET)

This API validates access token, if valid then returns a response with its expiry otherwise error.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/validate-access-token)

```php

$access_token = "access_token"; //Required

$result = $socialAPI->validateAccessToken($access_token);
```


Access Token Invalidate (GET)

This api invalidates the active access token or expires an access token validity.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/invalidate-access-token)

```php

$access_token = "access_token"; //Required

$result = $socialAPI->inValidateAccessToken($access_token);
```


Get Active Session Details (GET)

This api is use to get all active session by Access Token.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/get-active-session-details)

```php

$token = "token"; //Required

$result = $socialAPI->getActiveSession($token);
```


Get Active Session By Account Id (GET)

This api is used to get all active sessions by AccountID(UID).
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/active-session-by-account-id/)

```php

$accountId = "accountId"; //Required

$result = $socialAPI->getActiveSessionByAccountID($accountId);
```


Get Active Session By Profile Id (GET)

This api is used to get all active sessions by ProfileId.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/active-session-by-profile-id/)

```php

$profileId = "profileId"; //Required

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

### CustomObject API

List of APIs in this Section:

[PUT : Custom Object Update by Access Token](#UpdateCustomObjectByToken-put-)

[PUT : Custom Object Update by UID](#UpdateCustomObjectByUid-put-)

[POST : Create Custom Object by Token](#CreateCustomObjectByToken-post-)

[POST : Create Custom Object by UID](#CreateCustomObjectByUid-post-)

[GET : Custom Object by Token](#GetCustomObjectByToken-get-)

[GET : Custom Object by ObjectRecordId and Token](#GetCustomObjectByRecordIDAndToken-get-)

[GET : Custom Object By UID](#GetCustomObjectByUid-get-)

[GET : Custom Object by ObjectRecordId and UID](#GetCustomObjectByRecordID-get-)

[DELETE : Custom Object Delete by Record Id And Token](#DeleteCustomObjectByToken-delete-)

[DELETE : Account Delete Custom Object by ObjectRecordId](#DeleteCustomObjectByRecordID-delete-)

If you have not already initialized the CustomObject object do so now
```php
$customObjectAPI = new CustomObjectAPI();
```

Custom Object Update by Access Token (PUT)

This API is used to update the specified custom object data of the specified account. If the value of updatetype is 'replace' then it will fully replace custom object with the new custom object and if the value of updatetype is 'partialreplace' then it will perform an upsert type operation
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-update-by-objectrecordid-and-token)

```php

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

$result = $customObjectAPI->updateCustomObjectByToken($access_token,$objectName,$objectRecordId,$payload,$updateType);
```


Custom Object Update by UID (PUT)

This API is used to update the specified custom object data of a specified account. If the value of updatetype is 'replace' then it will fully replace custom object with new custom object and if the value of updatetype is partialreplace then it will perform an upsert type operation.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-update-by-objectrecordid-and-uid)

```php

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

$result = $customObjectAPI->updateCustomObjectByUid($objectName,$objectRecordId,$payload,$uid,$updateType);
```


Create Custom Object by Token (POST)

This API is used to write information in JSON format to the custom object for the specified account.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/create-custom-object-by-token)

```php

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

$result = $customObjectAPI->createCustomObjectByToken($access_token,$objectName,$payload);
```


Create Custom Object by UID (POST)

This API is used to write information in JSON format to the custom object for the specified account.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/create-custom-object-by-uid)

```php

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

$result = $customObjectAPI->createCustomObjectByUid($objectName,$payload,$uid);
```


Custom Object by Token (GET)

This API is used to retrieve the specified Custom Object data for the specified account.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-by-token)

```php

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

$result = $customObjectAPI->getCustomObjectByToken($access_token,$objectName);
```


Custom Object by ObjectRecordId and Token (GET)

This API is used to retrieve the Custom Object data for the specified account.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-by-objectrecordid-and-token)

```php

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

$result = $customObjectAPI->getCustomObjectByRecordIDAndToken($access_token,$objectName,$objectRecordId);
```


Custom Object By UID (GET)

This API is used to retrieve all the custom objects by UID from cloud storage.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-by-uid)

```php

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

$result = $customObjectAPI->getCustomObjectByUid($objectName,$uid);
```


Custom Object by ObjectRecordId and UID (GET)

This API is used to retrieve the Custom Object data for the specified account.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-by-objectrecordid-and-uid)

```php

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

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


Custom Object Delete by Record Id And Token (DELETE)

This API is used to remove the specified Custom Object data using ObjectRecordId of a specified account.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-delete-by-objectrecordid-and-token)

```php

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

$result = $customObjectAPI->deleteCustomObjectByToken($access_token,$objectName,$objectRecordId);
```


Account Delete Custom Object by ObjectRecordId (DELETE)

This API is used to remove the specified Custom Object data using ObjectRecordId of specified account.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-delete-by-objectrecordid-and-uid)

```php

$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](#ResetPasswordByPhoneOTP-put-)

[PUT : Phone Verification OTP](#PhoneVerificationByOTP-put-)

[PUT : Phone Verification OTP by Token](#PhoneVerificationOTPByAccessToken-put-)

[PUT : Phone Number Update](#UpdatePhoneNumber-put-)

[POST : Phone Login](#LoginByPhone-post-)

[POST : Phone Forgot Password by OTP](#ForgotPasswordByPhoneOTP-post-)

[POST : Phone Resend Verification OTP](#PhoneResendVerificationOTP-post-)

[POST : Phone Resend Verification OTP By Token](#PhoneResendVerificationOTPByToken-post-)

[POST : Phone User Registration by SMS](#UserRegistrationByPhone-post-)

[GET : Phone Number Availability](#CheckPhoneNumberAvailability-get-)

[DELETE : Remove Phone ID by Access Token](#RemovePhoneIDByAccessToken-delete-)

If you have not already initialized the PhoneAuthentication object do so now
```php
$phoneAuthenticationAPI = new PhoneAuthenticationAPI();
```

Phone Reset Password by OTP (PUT)

This API is used to reset the password
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-reset-password-by-otp)

```php

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

$result = $phoneAuthenticationAPI->resetPasswordByPhoneOTP($payload);
```


Phone Verification OTP (PUT)

This API is used to validate the verification code sent to verify a user's phone number
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-verify-otp)

```php

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

$result = $phoneAuthenticationAPI->phoneVerificationByOTP($otp,$phone,$fields,$smsTemplate,$isVoiceOtp);
```


Phone Verification OTP by Token (PUT)

This API is used to consume the verification code sent to verify a user's phone number. Use this call for front-end purposes in cases where the user is already logged in by passing the user's access token.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-verify-otp-by-token)

```php

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

$result = $phoneAuthenticationAPI->phoneVerificationOTPByAccessToken($access_token,$otp,$smsTemplate,$isVoiceOtp);
```


Phone Number Update (PUT)

This API is used to update the login Phone Number of users
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-number-update)

```php

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

$result = $phoneAuthenticationAPI->updatePhoneNumber($access_token,$phone,$smsTemplate,$isVoiceOtp);
```


Phone Login (POST)

This API retrieves a copy of the user data based on the Phone
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-login)

```php

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

$result = $phoneAuthenticationAPI->loginByPhone($payload,$fields,$loginUrl,$smsTemplate);
```


Phone Forgot Password by OTP (POST)

This API is used to send the OTP to reset the account password.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-forgot-password-by-otp)

```php

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

$result = $phoneAuthenticationAPI->forgotPasswordByPhoneOTP($phone,$smsTemplate,$isVoiceOtp);
```


Phone Resend Verification OTP (POST)

This API is used to resend a verification OTP to verify a user's Phone Number. The user will receive a verification code that they will need to input
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-resend-otp)

```php

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

$result = $phoneAuthenticationAPI->phoneResendVerificationOTP($phone,$smsTemplate,$isVoiceOtp);
```


Phone Resend Verification OTP By Token (POST)

This API is used to resend a verification OTP to verify a user's Phone Number in cases in which an active token already exists
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-resend-otp-by-token)

```php

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

$result = $phoneAuthenticationAPI->phoneResendVerificationOTPByToken($access_token,$phone,$smsTemplate);
```


Phone User Registration by SMS (POST)

This API registers the new users into your Cloud Storage and triggers the phone verification process.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-user-registration-by-sms)

```php

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

$result = $phoneAuthenticationAPI->userRegistrationByPhone($payload,$sott,$fields,$options,$smsTemplate,$verificationUrl,$welcomeEmailTemplate,$emailTemplate,$isVoiceOtp);
```


Phone Number Availability (GET)

This API is used to check the Phone Number exists or not on your site.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-number-availability)

```php

$phone = "phone"; //Required

$result = $phoneAuthenticationAPI->checkPhoneNumberAvailability($phone);
```


Remove Phone ID by Access Token (DELETE)

This API is used to delete the Phone ID on a user's account via the access token
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/remove-phone-id-by-access-token)

```php

$access_token = "access_token"; //Required

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

### MultiFactorAuthentication API

List of APIs in this Section:

[PUT : Update MFA Setting](#MFAUpdateSetting-put-)

[PUT : MFA Update Phone Number by Token](#MFAUpdatePhoneNumberByToken-put-)

[PUT : Verify MFA Email OTP by Access Token](#MFAValidateEmailOtpByAccessToken-put-)

[PUT : Update MFA Security Question by Access Token](#MFASecurityQuestionAnswerByAccessToken-put-)

[PUT : MFA Validate OTP](#MFAValidateOTPByPhone-put-)

[PUT : MFA Validate Backup code](#MFAValidateBackupCode-put-)

[PUT : MFA Update Phone Number](#MFAUpdatePhoneNumber-put-)

[PUT : Verify MFA Email OTP by MFA Token](#MFAValidateEmailOtp-put-)

[PUT : Update MFA Security Question by MFA Token](#MFASecurityQuestionAnswer-put-)

[PUT : MFA Validate Authenticator Code](#MFAValidateAuthenticatorCode-put-)

[PUT : MFA Verify Authenticator Code](#MFAVerifyAuthenticatorCode-put-)

[POST : MFA Email Login](#MFALoginByEmail-post-)

[POST : MFA UserName Login](#MFALoginByUserName-post-)

[POST : MFA Phone Login](#MFALoginByPhone-post-)

[POST : Send MFA Email OTP by MFA Token](#MFAEmailOTP-post-)

[POST : Verify MFA Security Question by MFA Token](#MFASecurityQuestionAnswerVerification-post-)

[GET : MFA Validate Access Token](#MFAConfigureByAccessToken-get-)

[GET : MFA Backup Code by Access Token](#MFABackupCodeByAccessToken-get-)

[GET : Reset Backup Code by Access Token](#MFAResetBackupCodeByAccessToken-get-)

[GET : Send MFA Email OTP by Access Token](#MFAEmailOtpByAccessToken-get-)

[GET : MFA Resend Otp](#MFAResendOTP-get-)

[GET : MFA Backup Code by UID](#MFABackupCodeByUid-get-)

[GET : MFA Reset Backup Code by UID](#MFAResetBackupCodeByUid-get-)

[DELETE : MFA Reset Authenticator by Token](#MFAResetAuthenticatorByToken-delete-)

[DELETE : MFA Reset SMS Authenticator by Token](#MFAResetSMSAuthByToken-delete-)

[DELETE : Reset MFA Email OTP Authenticator By Access Token](#MFAResetEmailOtpAuthenticatorByAccessToken-delete-)

[DELETE : MFA Reset Security Question Authenticator By Access Token](#MFAResetSecurityQuestionAuthenticatorByAccessToken-delete-)

[DELETE : MFA Reset SMS Authenticator By UID](#MFAResetSMSAuthenticatorByUid-delete-)

[DELETE : MFA Reset Authenticator By UID](#MFAResetAuthenticatorByUid-delete-)

[DELETE : Reset MFA Email OTP Authenticator Settings by Uid](#MFAResetEmailOtpAuthenticatorByUid-delete-)

[DELETE : Reset MFA Security Question Authenticator Settings by Uid](#MFAResetSecurityQuestionAuthenticatorByUid-delete-)

If you have not already initialized the MultiFactorAuthentication object do so now
```php
$multiFactorAuthenticationAPI = new MultiFactorAuthenticationAPI();
```

Update MFA Setting (PUT)

This API is used to trigger the Multi-factor authentication settings after login for secure actions
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/update-mfa-setting/)

```php

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

$result = $multiFactorAuthenticationAPI->mfaUpdateSetting($access_token,$payload,$fields);
```


MFA Update Phone Number by Token (PUT)

This API is used to update the Multi-factor authentication phone number by sending the verification OTP to the provided phone number
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-update-phone-number-by-token/)

```php

$access_token = "access_token"; //Required
$phoneNo2FA = "phoneNo2FA"; //Required
$smsTemplate2FA = "smsTemplate2FA"; //Optional
$isVoiceOtp = false; //Optional
$options = "options"; //Optional

$result = $multiFactorAuthenticationAPI->mfaUpdatePhoneNumberByToken($access_token,$phoneNo2FA,$smsTemplate2FA,$isVoiceOtp,$options);
```


Verify MFA Email OTP by Access Token (PUT)

This API is used to set up MFA Email OTP authenticator on profile after login.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/verify-mfa-otp-by-access-token/)

```php

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

$result = $multiFactorAuthenticationAPI->mfaValidateEmailOtpByAccessToken($access_token,$payload);
```


Update MFA Security Question by Access Token (PUT)

This API is used to set up MFA Security Question authenticator on profile after login.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/update-mfa-security-question-by-access-token)

```php

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

$result = $multiFactorAuthenticationAPI->mfaSecurityQuestionAnswerByAccessToken($access_token,$payload);
```


MFA Validate OTP (PUT)

This API is used to login via Multi-factor authentication by passing the One Time Password received via SMS
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-validate-otp/)

```php

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

$result = $multiFactorAuthenticationAPI->mfaValidateOTPByPhone($payload,$secondFactorAuthenticationToken,$fields,$smsTemplate2FA,$rbaBrowserEmailTemplate,$rbaCityEmailTemplate,$rbaCountryEmailTemplate,$rbaIpEmailTemplate);
```


MFA Validate Backup code (PUT)

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

```php

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

$result = $multiFactorAuthenticationAPI->mfaValidateBackupCode($payload,$secondFactorAuthenticationToken,$fields,$rbaBrowserEmailTemplate,$rbaCityEmailTemplate,$rbaCountryEmailTemplate,$rbaIpEmailTemplate);
```


MFA Update Phone Number (PUT)

This API is used to update (if configured) the phone number used for Multi-factor authentication by sending the verification OTP to the provided phone number
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-update-phone-number/)

```php

$phoneNo2FA = "phoneNo2FA"; //Required
$secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required
$smsTemplate2FA = "smsTemplate2FA"; //Optional
$isVoiceOtp = false; //Optional
$options = "options"; //Optional


$result = $multiFactorAuthenticationAPI->mfaUpdatePhoneNumber($phoneNo2FA,$secondFactorAuthenticationToken,$smsTemplate2FA,$isVoiceOtp,$options);
```


Verify MFA Email OTP by MFA Token (PUT)

This API is used to Verify MFA Email OTP by MFA Token
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/verify-mfa-email-otp-by-mfa-token/)

```php

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

$result = $multiFactorAuthenticationAPI->mfaValidateEmailOtp($payload,$secondFactorAuthenticationToken,$rbaBrowserEmailTemplate,$rbaCityEmailTemplate,$rbaCountryEmailTemplate,$rbaIpEmailTemplate);
```


Update MFA Security Question by MFA Token (PUT)

This API is used to set the security questions on the profile with the MFA token when MFA flow is required.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/update-mfa-security-question-by-mfa-token/)

```php

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

$result = $multiFactorAuthenticationAPI->mfaSecurityQuestionAnswer($payload,$secondFactorAuthenticationToken);
```

MFA Validate Authenticator Code (PUT)

This API is used to login to a user's account during the second MFA step with an Authenticator Code. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/authenticator/mfa-validate-authenticator-code/)

```php

$payload = '{
"authenticatorCode" : ""
}'; //Required
$secondfactorauthenticationtoken = "secondfactorauthenticationtoken"; //Required
$fields = null; //Optional

$result = $multiFactorAuthenticationAPI->mfaValidateAuthenticatorCode($payload,$secondfactorauthenticationtoken,$fields);
```

MFA Verify Authenticator Code (PUT)

This API is used to validate an Authenticator Code as part of the MFA process. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/authenticator/mfa-verify-authenticator-code/)

```php

$access_token = "access_token"; //Required
$payload = '{
"authenticatorCode" : ""
}'; //Required
$fields = null; //Optional

$result = $multiFactorAuthenticationAPI->mfaVerifyAuthenticatorCode($access_token,$payload,$fields);
```

MFA Email Login (POST)

This API can be used to login by emailid on a Multi-factor authentication enabled LoginRadius site.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-email-login)

```php

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

$result = $multiFactorAuthenticationAPI->mfaLoginByEmail($email,$password,$emailTemplate,$fields,$loginUrl,$smsTemplate,$smsTemplate2FA,$verificationUrl,$emailTemplate2FA,$isVoiceOtp,$options);
```


MFA UserName Login (POST)

This API can be used to login by username on a Multi-factor authentication enabled LoginRadius site.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-user-name-login)

```php

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

$result = $multiFactorAuthenticationAPI->mfaLoginByUserName($password,$username,$emailTemplate,$fields,$loginUrl,$smsTemplate,$smsTemplate2FA,$verificationUrl,$emailTemplate2FA,$isVoiceOtp);
```


MFA Phone Login (POST)

This API can be used to login by Phone on a Multi-factor authentication enabled LoginRadius site.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-phone-login)

```php

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

$result = $multiFactorAuthenticationAPI->mfaLoginByPhone($password,$phone,$emailTemplate,$fields,$loginUrl,$smsTemplate,$smsTemplate2FA,$verificationUrl,$emailTemplate2FA,$isVoiceOtp,$options);
```


Send MFA Email OTP by MFA Token (POST)

An API designed to send the MFA Email OTP to the email.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/send-mfa-email-otp-by-mfa-token/)

```php

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

$result = $multiFactorAuthenticationAPI->mfaEmailOTP($payload,$secondFactorAuthenticationToken,$emailTemplate2FA);
```


Verify MFA Security Question by MFA Token (POST)

This API is used to resending the verification OTP to the provided phone number
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/verify-mfa-security-question-by-mfa-token/)

```php

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

$result = $multiFactorAuthenticationAPI->mfaSecurityQuestionAnswerVerification($payload,$secondFactorAuthenticationToken,$rbaBrowserEmailTemplate,$rbaCityEmailTemplate,$rbaCountryEmailTemplate,$rbaIpEmailTemplate);
```


MFA Validate Access Token (GET)

This API is used to configure the Multi-factor authentication after login by using the access token when MFA is set as optional on the LoginRadius site.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-validate-access-token/)

```php

$access_token = "access_token"; //Required
$isVoiceOtp = false; //Optional

$result = $multiFactorAuthenticationAPI->mfaConfigureByAccessToken($access_token,$isVoiceOtp);
```


MFA Backup Code by Access Token (GET)

This API is used to get a set of backup codes via access token to allow the user login on a site that has Multi-factor Authentication enabled in the event that the user does not have a secondary factor available. We generate 10 codes, each code can only be consumed once. If any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/mfa-backup-code-by-access-token/)

```php

$access_token = "access_token"; //Required

$result = $multiFactorAuthenticationAPI->mfaBackupCodeByAccessToken($access_token);
```


Reset Backup Code by Access Token (GET)

API is used to reset the backup codes on a given account via the access token. This API call will generate 10 new codes, each code can only be consumed once
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/mfa-reset-backup-code-by-access-token/)

```php

$access_token = "access_token"; //Required

$result = $multiFactorAuthenticationAPI->mfaResetBackupCodeByAccessToken($access_token);
```


Send MFA Email OTP by Access Token (GET)

This API is created to send the OTP to the email if email OTP authenticator is enabled in app's MFA configuration.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/send-mfa-email-otp-by-access-token/)

```php

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

$result = $multiFactorAuthenticationAPI->mfaEmailOtpByAccessToken($access_token,$emailId,$emailTemplate2FA);
```


MFA Resend Otp (GET)

This API is used to resending the verification OTP to the provided phone number
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/resend-twofactorauthentication-otp/)

```php

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

$result = $multiFactorAuthenticationAPI->mfaResendOTP($secondFactorAuthenticationToken,$smsTemplate2FA,$isVoiceOtp);
```


MFA Backup Code by UID (GET)

This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/mfa-backup-code-by-uid/)

```php

$uid = "uid"; //Required

$result = $multiFactorAuthenticationAPI->mfaBackupCodeByUid($uid);
```


MFA Reset Backup Code by UID (GET)

This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/mfa-reset-backup-code-by-uid/)

```php

$uid = "uid"; //Required

$result = $multiFactorAuthenticationAPI->mfaResetBackupCodeByUid($uid);
```

MFA Reset Authenticator by Token (DELETE)

This API Resets the Authenticator configurations on a given account via the access_token. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/authenticator/mfa-reset-authenticator-by-token/)

```php

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

$result = $multiFactorAuthenticationAPI->mfaResetAuthenticatorByToken($access_token,$authenticator);
```


MFA Reset SMS Authenticator by Token (DELETE)

This API resets the SMS Authenticator configurations on a given account via the access token.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-reset-sms-authenticator-by-token/)

```php

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

$result = $multiFactorAuthenticationAPI->mfaResetSMSAuthByToken($access_token,$otpauthenticator);
```


Reset MFA Email OTP Authenticator By Access Token (DELETE)

This API is used to reset the Email OTP Authenticator settings for an MFA-enabled user
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/reset-mfa-email-otp-authenticator-access-token/)

```php

$access_token = "access_token"; //Required

$result = $multiFactorAuthenticationAPI->mfaResetEmailOtpAuthenticatorByAccessToken($access_token);
```


MFA Reset Security Question Authenticator By Access Token (DELETE)

This API is used to Reset MFA Security Question Authenticator By Access Token
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/reset-mfa-security-question-by-access-token/)

```php

$access_token = "access_token"; //Required

$result = $multiFactorAuthenticationAPI->mfaResetSecurityQuestionAuthenticatorByAccessToken($access_token);
```


MFA Reset SMS Authenticator By UID (DELETE)

This API resets the SMS Authenticator configurations on a given account via the UID.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-reset-sms-authenticator-by-uid/)

```php

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

$result = $multiFactorAuthenticationAPI->mfaResetSMSAuthenticatorByUid($otpauthenticator,$uid);
```

MFA Reset Authenticator By UID (DELETE)

This API resets the Authenticator configurations on a given account via the UID. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/authenticator/mfa-reset-authenticator-by-uid/)

```php

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

$result = $multiFactorAuthenticationAPI->mfaResetAuthenticatorByUid($authenticator,$uid);
```


Reset MFA Email OTP Authenticator Settings by Uid (DELETE)

This API is used to reset the Email OTP Authenticator settings for an MFA-enabled user.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/reset-mfa-email-otp-authenticator-settings-by-uid/)

```php

$uid = "uid"; //Required

$result = $multiFactorAuthenticationAPI->mfaResetEmailOtpAuthenticatorByUid($uid);
```


Reset MFA Security Question Authenticator Settings by Uid (DELETE)

This API is used to reset the Security Question Authenticator settings for an MFA-enabled user.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/reset-mfa-security-question-authenticator-settings-by-uid/)

```php

$uid = "uid"; //Required

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

### PINAuthentication API

List of APIs in this Section:

[PUT : Reset PIN By ResetToken](#ResetPINByResetToken-put-)

[PUT : Reset PIN By SecurityAnswer And Email](#ResetPINByEmailAndSecurityAnswer-put-)

[PUT : Reset PIN By SecurityAnswer And Username](#ResetPINByUsernameAndSecurityAnswer-put-)

[PUT : Reset PIN By SecurityAnswer And Phone](#ResetPINByPhoneAndSecurityAnswer-put-)

[PUT : Change PIN By Token](#ChangePINByAccessToken-put-)

[PUT : Reset PIN by Phone and OTP](#ResetPINByPhoneAndOtp-put-)

[PUT : Reset PIN by Email and OTP](#ResetPINByEmailAndOtp-put-)

[PUT : Reset PIN by Username and OTP](#ResetPINByUsernameAndOtp-put-)

[POST : PIN Login](#PINLogin-post-)

[POST : Forgot PIN By Email](#SendForgotPINEmailByEmail-post-)

[POST : Forgot PIN By UserName](#SendForgotPINEmailByUsername-post-)

[POST : Forgot PIN By Phone](#SendForgotPINSMSByPhone-post-)

[POST : Set PIN By PinAuthToken](#SetPINByPinAuthToken-post-)

[GET : Invalidate PIN Session Token](#InValidatePinSessionToken-get-)

If you have not already initialized the PINAuthentication object do so now
```php
$pinAuthenticationAPI = new PINAuthenticationAPI();
```

Reset PIN By ResetToken (PUT)

This API is used to reset pin using reset token.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-resettoken/)

```php

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

$result = $pinAuthenticationAPI->resetPINByResetToken($payload);
```


Reset PIN By SecurityAnswer And Email (PUT)

This API is used to reset pin using security question answer and email.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-securityanswer-and-email/)

```php

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

$result = $pinAuthenticationAPI->resetPINByEmailAndSecurityAnswer($payload);
```


Reset PIN By SecurityAnswer And Username (PUT)

This API is used to reset pin using security question answer and username.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-securityanswer-and-username/)

```php

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

$result = $pinAuthenticationAPI->resetPINByUsernameAndSecurityAnswer($payload);
```


Reset PIN By SecurityAnswer And Phone (PUT)

This API is used to reset pin using security question answer and phone.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-securityanswer-and-phone/)

```php

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

$result = $pinAuthenticationAPI->resetPINByPhoneAndSecurityAnswer($payload);
```


Change PIN By Token (PUT)

This API is used to change a user's PIN using access token.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/change-pin-by-access-token/)

```php

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

$result = $pinAuthenticationAPI->changePINByAccessToken($access_token,$payload);
```


Reset PIN by Phone and OTP (PUT)

This API is used to reset pin using phoneId and OTP.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-phone-and-otp/)

```php

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

$result = $pinAuthenticationAPI->resetPINByPhoneAndOtp($payload);
```


Reset PIN by Email and OTP (PUT)

This API is used to reset pin using email and OTP.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-email-and-otp/)

```php

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

$result = $pinAuthenticationAPI->resetPINByEmailAndOtp($payload);
```


Reset PIN by Username and OTP (PUT)

This API is used to reset pin using username and OTP.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-username-and-otp/)

```php

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

$result = $pinAuthenticationAPI->resetPINByUsernameAndOtp($payload);
```


PIN Login (POST)

This API is used to login a user by pin and session token.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/login-by-pin/)

```php

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

$result = $pinAuthenticationAPI->pinLogin($payload,$session_token);
```


Forgot PIN By Email (POST)

This API sends the reset pin email to specified email address.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/forgot-pin-by-email/)

```php

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

$result = $pinAuthenticationAPI->sendForgotPINEmailByEmail($payload,$emailTemplate,$resetPINUrl);
```


Forgot PIN By UserName (POST)

This API sends the reset pin email using username.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/forgot-pin-by-username/)

```php

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

$result = $pinAuthenticationAPI->sendForgotPINEmailByUsername($payload,$emailTemplate,$resetPINUrl);
```


Forgot PIN By Phone (POST)

This API sends the OTP to specified phone number
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/forgot-pin-by-phone/)

```php

$payload = '{
"phone" : ""
}'; //Required
$smsTemplate = "smsTemplate"; //Optional
$isVoiceOtp = false; //Optional

$result = $pinAuthenticationAPI->sendForgotPINSMSByPhone($payload,$smsTemplate,$isVoiceOtp);
```


Set PIN By PinAuthToken (POST)

This API is used to change a user's PIN using Pin Auth token.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/set-pin-by-pinauthtoken/)

```php

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

$result = $pinAuthenticationAPI->setPINByPinAuthToken($payload,$pinAuthToken);
```


Invalidate PIN Session Token (GET)

This API is used to invalidate pin session token.
[More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/invalidate-pin-session-token/)

```php

$session_token = "session_token"; //Required

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

### ReAuthentication API

List of APIs in this Section:

[PUT : Validate MFA by OTP](#MFAReAuthenticateByOTP-put-)

[PUT : Validate MFA by Backup Code](#MFAReAuthenticateByBackupCode-put-)

[PUT : Validate MFA by Password](#MFAReAuthenticateByPassword-put-)

[PUT : MFA Re-authentication by PIN](#VerifyPINAuthentication-put-)

[PUT : MFA Re-authentication by Email OTP](#ReAuthValidateEmailOtp-put-)

[PUT : MFA Step-Up Authentication by Authenticator Code](#MFAReAuthenticateByAuthenticatorCode-put-)

[POST : Verify Multifactor OTP Authentication](#VerifyMultiFactorOtpReauthentication-post-)

[POST : Verify Multifactor Password Authentication](#VerifyMultiFactorPasswo