https://github.com/loginradius/html5-sdk
The LoginRadius html5 and JS library will let you integrate LoginRadius' customer identity platform with your HTML5/JS application(s).
https://github.com/loginradius/html5-sdk
customer-registration html5-sdk identity-management javascript loginradius single-page-app single-sign-on social-login
Last synced: about 1 year ago
JSON representation
The LoginRadius html5 and JS library will let you integrate LoginRadius' customer identity platform with your HTML5/JS application(s).
- Host: GitHub
- URL: https://github.com/loginradius/html5-sdk
- Owner: LoginRadius
- License: mit
- Created: 2012-11-19T14:35:03.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2025-03-29T11:37:39.000Z (about 1 year ago)
- Last Synced: 2025-04-07T07:07:37.416Z (about 1 year ago)
- Topics: customer-registration, html5-sdk, identity-management, javascript, loginradius, single-page-app, single-sign-on, social-login
- Language: JavaScript
- Homepage: https://www.loginradius.com
- Size: 754 KB
- Stars: 9
- Watchers: 6
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# LoginRadius HTML5 SDK
Customer Identity public repo for the HTML5 SDK, based on LoginRadius V2 APIs.

## Introduction ##
LoginRadius HTML 5 Customer Registration wrapper provides access to LoginRadius Identity Platform API.
LoginRadius is an Identity Management Platform that simplifies user registration while securing data. LoginRadius Platform simplifies and secures your user registration process, increases conversion with Social Login that combines 30 major social platforms, and offers a full solution with Traditional Customer Registration. You can gather a wealth of user profile data from Social Login or Traditional Customer Registration. This SDK includes support for the LoginRadius Authentication APIs, Custom Object Management APIs and Social APIs.
LoginRadius centralizes it all in one place, making it easy to manage and access. Easily integrate LoginRadius with all of your third-party applications, like MailChimp, Google Analytics, Livefyre and many more, making it easy to utilize the data you are capturing.
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.
Please visit [here](http://www.loginradius.com/) for more information.
## Documentation
-----
HTML5 SDK provides an approach to access LoginRadius service with only HTML and Javascript Get a Full Demo
>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
In order to utilize the HTML5/JS SDK, you will need to initialize the SDK with your API Key:
```
var sdkoptions = {
"apiKey": "{{YOUR API KEY}}"
}
LoginRadiusSDK.initSDK(sdkoptions);
```
### X-Origin-IP
LoginRadius allows you to 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.
```
var sdkoptions = {
"originIp": "{{CLIENT IP}}"
}
```
## Importing Required Libraries
- Download the SDK from [Github](https://github.com/LoginRadius/HTML5-SDK).
- Include the SDK javascript file on your website.
## HTML
```
```
## Getting the Access Token
The Access Token will be automatically retrieved from logins performed via our LoginRadiusV2.js interface.
While it is required for many of the API Calls in our Authentication API, You can simple pass it.
However, if you need to manually retrieve the token, it can be done using ```LoginRadiusSDK.getToken()```
>Note
please make sure that all the API functions, are asynchronous.
## APIs
With the api key initialized and the access token, once a user has logged in, we can invoke any of these functions to grab data. However, this is dependent on the provider and permissions for each.
Note: All of the listed arguments must be passed for each function if you do not want
to pass a value simply pass an empty string `""`
When jsObject is listed as an argument you must pass in an Object as required for the specific API Call in our documentation.
### 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-)
* DELETE : [Auth Delete Account with Email Confirmation](#DeleteAccountWithEmailConfirmation-delete-)
* DELETE : [Auth Remove Email](#RemoveEmail-delete-)
* DELETE : [Auth Unlink Social Identities](#UnlinkSocialIdentities-delete-)
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/)
```
var accessToken = ""; //Required
var userProfileUpdateModel ={
"firstName" : "",
"lastName" : ""
}; //Required
var emailTemplate = ""; //Optional
var fields = null; //Optional
var nullSupport = true; //Optional
var smsTemplate = ""; //Optional
var verificationUrl = ""; //Optional
LoginRadiusSDK.authenticationApi.updateProfileByAccessToken(accessToken, userProfileUpdateModel, emailTemplate, fields, nullSupport, smsTemplate, verificationUrl, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var accessToken = ""; //Required
var unlockProfileModel ={
"g-recaptcha-response" : ""
}; //Required
LoginRadiusSDK.authenticationApi.unlockAccountByToken(accessToken, unlockProfileModel, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var emailVerificationByOtpModel ={
"email" : "",
"otp" : ""
}; //Required
var fields = null; //Optional
var url = ""; //Optional
var welcomeEmailTemplate = ""; //Optional
LoginRadiusSDK.authenticationApi.verifyEmailByOTP(emailVerificationByOtpModel, fields, url, welcomeEmailTemplate, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var resetPasswordBySecurityAnswerAndEmailModel ={
"email" : "",
"password" : "",
"securityAnswer" : {"QuestionID":"Answer"}
}; //Required
LoginRadiusSDK.authenticationApi.resetPasswordBySecurityAnswerAndEmail(resetPasswordBySecurityAnswerAndEmailModel, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var resetPasswordBySecurityAnswerAndPhoneModel ={
"password" : "",
"phone" : "",
"securityAnswer" : {"QuestionID":"Answer"}
}; //Required
LoginRadiusSDK.authenticationApi.resetPasswordBySecurityAnswerAndPhone(resetPasswordBySecurityAnswerAndPhoneModel, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var resetPasswordBySecurityAnswerAndUserNameModel ={
"password" : "",
"securityAnswer" : {"QuestionID":"Answer"},
"userName" : ""
}; //Required
LoginRadiusSDK.authenticationApi.resetPasswordBySecurityAnswerAndUserName(resetPasswordBySecurityAnswerAndUserNameModel, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var resetPasswordByResetTokenModel ={
"password" : "",
"resetToken" : ""
}; //Required
LoginRadiusSDK.authenticationApi.resetPasswordByResetToken(resetPasswordByResetTokenModel, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var resetPasswordByEmailAndOtpModel ={
"email" : "",
"otp" : "",
"password" : ""
}; //Required
LoginRadiusSDK.authenticationApi.resetPasswordByEmailOTP(resetPasswordByEmailAndOtpModel, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var resetPasswordByUserNameModel ={
"otp" : "",
"password" : "",
"userName" : ""
}; //Required
LoginRadiusSDK.authenticationApi.resetPasswordByOTPAndUserName(resetPasswordByUserNameModel, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var accessToken = ""; //Required
var newPassword = ""; //Required
var oldPassword = ""; //Required
LoginRadiusSDK.authenticationApi.changePassword(accessToken, newPassword, oldPassword, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var accessToken = ""; //Required
var username = ""; //Required
LoginRadiusSDK.authenticationApi.setOrChangeUserName(accessToken, username, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var email = ""; //Required
var emailTemplate = ""; //Optional
var verificationUrl = ""; //Optional
LoginRadiusSDK.authenticationApi.authResendEmailVerification(email, emailTemplate, verificationUrl, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var accessToken = ""; //Required
var email = ""; //Required
var type = ""; //Required
var emailTemplate = ""; //Optional
var verificationUrl = ""; //Optional
LoginRadiusSDK.authenticationApi.addEmail(accessToken, email, type, emailTemplate, verificationUrl, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var emailAuthenticationModel ={
"email" : "",
"password" : ""
}; //Required
var emailTemplate = ""; //Optional
var fields = null; //Optional
var loginUrl = ""; //Optional
var verificationUrl = ""; //Optional
LoginRadiusSDK.authenticationApi.loginByEmail(emailAuthenticationModel, emailTemplate, fields, loginUrl, verificationUrl, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var userNameAuthenticationModel ={
"password" : "",
"username" : ""
}; //Required
var emailTemplate = ""; //Optional
var fields = null; //Optional
var loginUrl = ""; //Optional
var verificationUrl = ""; //Optional
LoginRadiusSDK.authenticationApi.loginByUserName(userNameAuthenticationModel, emailTemplate, fields, loginUrl, verificationUrl, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var email = ""; //Required
var resetPasswordUrl = ""; //Required
var emailTemplate = ""; //Optional
LoginRadiusSDK.authenticationApi.forgotPassword(email, resetPasswordUrl, emailTemplate, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var accessToken = ""; //Required
var candidateToken = ""; //Required
LoginRadiusSDK.authenticationApi.linkSocialIdentities(accessToken, candidateToken, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var accessToken = ""; //Required
var clientGuid = ""; //Required
LoginRadiusSDK.authenticationApi.linkSocialIdentitiesByPing(accessToken, clientGuid, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var authUserRegistrationModel ={
"email" : [ {
"type" : "" ,
"value" : ""
} ] ,
"firstName" : "",
"lastName" : "",
"password" : ""
}; //Required
var sott = ""; //Required
var emailTemplate = ""; //Optional
var fields = null; //Optional
var options = ""; //Optional
var verificationUrl = ""; //Optional
var welcomeEmailTemplate = ""; //Optional
LoginRadiusSDK.authenticationApi.userRegistrationByEmail(authUserRegistrationModel, sott, emailTemplate, fields, options, verificationUrl, welcomeEmailTemplate, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var authUserRegistrationModelWithCaptcha ={
"email" : [ {
"type" : "" ,
"value" : ""
} ] ,
"firstName" : "",
"g-recaptcha-response" : "",
"lastName" : "",
"password" : ""
}; //Required
var emailTemplate = ""; //Optional
var fields = null; //Optional
var options = ""; //Optional
var smsTemplate = ""; //Optional
var verificationUrl = ""; //Optional
var welcomeEmailTemplate = ""; //Optional
LoginRadiusSDK.authenticationApi.userRegistrationByCaptcha(authUserRegistrationModelWithCaptcha, emailTemplate, fields, options, smsTemplate, verificationUrl, welcomeEmailTemplate, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var email = ""; //Required
LoginRadiusSDK.authenticationApi.getSecurityQuestionsByEmail(email, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var userName = ""; //Required
LoginRadiusSDK.authenticationApi.getSecurityQuestionsByUserName(userName, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var phone = ""; //Required
LoginRadiusSDK.authenticationApi.getSecurityQuestionsByPhone(phone, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var accessToken = ""; //Required
LoginRadiusSDK.authenticationApi.getSecurityQuestionsByAccessToken(accessToken, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var accessToken = ""; //Required
LoginRadiusSDK.authenticationApi.authValidateAccessToken(accessToken, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var accessToken = ""; //Required
var preventRefresh = true; //Optional
LoginRadiusSDK.authenticationApi.authInValidateAccessToken(accessToken, preventRefresh, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var accessToken = ""; //Required
LoginRadiusSDK.authenticationApi.getAccessTokenInfo(accessToken, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var accessToken = ""; //Required
var fields = null; //Optional
var emailTemplate = ""; //Optional
var verificationUrl = ""; //Optional
var welcomeEmailTemplate = ""; //Optional
LoginRadiusSDK.authenticationApi.getProfileByAccessToken(accessToken, fields,emailTemplate, verificationUrl, welcomeEmailTemplate, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var accessToken = ""; //Required
var welcomeEmailTemplate = ""; //Optional
LoginRadiusSDK.authenticationApi.sendWelcomeEmail(accessToken, welcomeEmailTemplate, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var deletetoken = ""; //Required
LoginRadiusSDK.authenticationApi.deleteAccountByDeleteToken(deletetoken, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var clientGuid = ""; //Required
var emailTemplate = ""; //Optional
var fields = null; //Optional
var verificationUrl = ""; //Optional
var welcomeEmailTemplate = ""; //Optional
LoginRadiusSDK.authenticationApi.getProfileByPing(clientGuid, emailTemplate, fields, verificationUrl, welcomeEmailTemplate, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var email = ""; //Required
LoginRadiusSDK.authenticationApi.checkEmailAvailability(email, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var verificationToken = ""; //Required
var fields = null; //Optional
var url = ""; //Optional
var welcomeEmailTemplate = ""; //Optional
LoginRadiusSDK.authenticationApi.verifyEmail(verificationToken, fields, url, welcomeEmailTemplate, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var username = ""; //Required
LoginRadiusSDK.authenticationApi.checkUserNameAvailability(username, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var accessToken = ""; //Required
var fields = null; //Optional
LoginRadiusSDK.authenticationApi.acceptPrivacyPolicy(accessToken, fields, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var accessToken = ""; //Required
LoginRadiusSDK.authenticationApi.getPrivacyPolicyHistoryByAccessToken(accessToken, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var accessToken = ""; //Required
var deleteUrl = ""; //Optional
var emailTemplate = ""; //Optional
LoginRadiusSDK.authenticationApi.deleteAccountWithEmailConfirmation(accessToken, deleteUrl, emailTemplate, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var accessToken = ""; //Required
var email = ""; //Required
LoginRadiusSDK.authenticationApi.removeEmail(accessToken, email, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var accessToken = ""; //Required
var provider = ""; //Required
var providerId = ""; //Required
LoginRadiusSDK.authenticationApi.unlinkSocialIdentities(accessToken, provider, providerId, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
### Social API
List of APIs in this Section:
* POST : [Post Message API](#PostMessage-post-)
* POST : [Status Posting ](#StatusPosting-post-)
* POST : [Trackable Status Posting](#TrackableStatusPosting-post-)
* GET : [Album](#GetAlbums-get-)
* GET : [Get Albums with cursor](#GetAlbumsWithCursor-get-)
* GET : [Audio](#GetAudios-get-)
* GET : [Get Audio With Cursor](#GetAudiosWithCursor-get-)
* GET : [Check In](#GetCheckIns-get-)
* GET : [Get CheckIns With Cursor](#GetCheckInsWithCursor-get-)
* GET : [Contact](#GetContacts-get-)
* GET : [Event](#GetEvents-get-)
* GET : [Get Events With Cursor](#GetEventsWithCursor-get-)
* GET : [Following](#GetFollowings-get-)
* GET : [Get Followings With Cursor](#GetFollowingsWithCursor-get-)
* GET : [Group](#GetGroups-get-)
* GET : [Get Groups With Cursor](#GetGroupsWithCursor-get-)
* GET : [Like](#GetLikes-get-)
* GET : [Get Likes With Cursor](#GetLikesWithCursor-get-)
* GET : [Mention](#GetMentions-get-)
* GET : [Page](#GetPage-get-)
* GET : [Photo](#GetPhotos-get-)
* GET : [Get Post](#GetPosts-get-)
* GET : [Get Trackable Status Stats](#GetTrackableStatusStats-get-)
* GET : [Refresh User Profile](#GetRefreshedSocialUserProfile-get-)
* GET : [Video](#GetVideos-get-)
Post Message API (POST)
Post Message API is used to post messages to the user's contacts.
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)
```
var accessToken = ""; //Required
var message = ""; //Required
var subject = ""; //Required
var to = ""; //Required
LoginRadiusSDK.socialApi.postMessage(accessToken, message, subject, to, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Status Posting (POST)
The Status API is used to update the status on the user's wall.
Supported Providers: Facebook, Twitter, LinkedIn [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/status-posting/)
```
var accessToken = ""; //Required
var caption = ""; //Required
var description = ""; //Required
var imageurl = ""; //Required
var status = ""; //Required
var title = ""; //Required
var url = ""; //Required
var shorturl = ""; //Optional
LoginRadiusSDK.socialApi.statusPosting(accessToken, caption, description, imageurl, status, title, url, shorturl, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Trackable Status Posting (POST)
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.
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/)
```
var accessToken = ""; //Required
var statusModel ={
"caption" : "",
"description" : "",
"imageurl" : "",
"status" : "",
"title" : "",
"url" : ""
}; //Required
LoginRadiusSDK.socialApi.trackableStatusPosting(accessToken, statusModel, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Album (GET)
Supported Providers: Facebook, Google, Live, Vkontakte.
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/)
```
var accessToken = ""; //Required
LoginRadiusSDK.socialApi.getAlbums(accessToken, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Get Albums with cursor (GET)
Supported Providers: Facebook, Google, Live, Vkontakte.
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/)
```
var accessToken = ""; //Required
var nextCursor = ""; //Required
LoginRadiusSDK.socialApi.getAlbumsWithCursor(accessToken, nextCursor, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Audio (GET)
The Audio API is used to get audio files data from the user's social account.
Supported Providers: Live, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/audio)
```
var accessToken = ""; //Required
LoginRadiusSDK.socialApi.getAudios(accessToken, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Get Audio With Cursor (GET)
The Audio API is used to get audio files data from the user's social account.
Supported Providers: Live, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/audio)
```
var accessToken = ""; //Required
var nextCursor = ""; //Required
LoginRadiusSDK.socialApi.getAudiosWithCursor(accessToken, nextCursor, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Check In (GET)
The Check In API is used to get check Ins data from the user's social account.
Supported Providers: Facebook, Foursquare, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/check-in)
```
var accessToken = ""; //Required
LoginRadiusSDK.socialApi.getCheckIns(accessToken, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Get CheckIns With Cursor (GET)
The Check In API is used to get check Ins data from the user's social account.
Supported Providers: Facebook, Foursquare, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/check-in)
```
var accessToken = ""; //Required
var nextCursor = ""; //Required
LoginRadiusSDK.socialApi.getCheckInsWithCursor(accessToken, nextCursor, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Contact (GET)
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.
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)
```
var accessToken = ""; //Required
var nextCursor = ""; //Optional
LoginRadiusSDK.socialApi.getContacts(accessToken, nextCursor, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Event (GET)
The Event API is used to get the event data from the user's social account.
Supported Providers: Facebook, Live [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/event)
```
var accessToken = ""; //Required
LoginRadiusSDK.socialApi.getEvents(accessToken, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Get Events With Cursor (GET)
The Event API is used to get the event data from the user's social account.
Supported Providers: Facebook, Live [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/event)
```
var accessToken = ""; //Required
var nextCursor = ""; //Required
LoginRadiusSDK.socialApi.getEventsWithCursor(accessToken, nextCursor, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Following (GET)
Get the following user list from the user's social account.
Supported Providers: Twitter [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/following)
```
var accessToken = ""; //Required
LoginRadiusSDK.socialApi.getFollowings(accessToken, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Get Followings With Cursor (GET)
Get the following user list from the user's social account.
Supported Providers: Twitter [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/following)
```
var accessToken = ""; //Required
var nextCursor = ""; //Required
LoginRadiusSDK.socialApi.getFollowingsWithCursor(accessToken, nextCursor, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Group (GET)
The Group API is used to get group data from the user's social account.
Supported Providers: Facebook, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/group)
```
var accessToken = ""; //Required
LoginRadiusSDK.socialApi.getGroups(accessToken, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Get Groups With Cursor (GET)
The Group API is used to get group data from the user's social account.
Supported Providers: Facebook, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/group)
```
var accessToken = ""; //Required
var nextCursor = ""; //Required
LoginRadiusSDK.socialApi.getGroupsWithCursor(accessToken, nextCursor, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Like (GET)
The Like API is used to get likes data from the user's social account.
Supported Providers: Facebook [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/like)
```
var accessToken = ""; //Required
LoginRadiusSDK.socialApi.getLikes(accessToken, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Get Likes With Cursor (GET)
The Like API is used to get likes data from the user's social account.
Supported Providers: Facebook [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/like)
```
var accessToken = ""; //Required
var nextCursor = ""; //Required
LoginRadiusSDK.socialApi.getLikesWithCursor(accessToken, nextCursor, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Mention (GET)
The Mention API is used to get mentions data from the user's social account.
Supported Providers: Twitter [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/mention)
```
var accessToken = ""; //Required
LoginRadiusSDK.socialApi.getMentions(accessToken, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Page (GET)
The Page API is used to get the page data from the user's social account.
Supported Providers: Facebook, LinkedIn [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/page)
```
var accessToken = ""; //Required
var pageName = ""; //Required
LoginRadiusSDK.socialApi.getPage(accessToken, pageName, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Photo (GET)
The Photo API is used to get photo data from the user's social account.
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)
```
var accessToken = ""; //Required
var albumId = ""; //Required
LoginRadiusSDK.socialApi.getPhotos(accessToken, albumId, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Get Post (GET)
The Post API is used to get post message data from the user's social account.
Supported Providers: Facebook [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/post)
```
var accessToken = ""; //Required
LoginRadiusSDK.socialApi.getPosts(accessToken, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Get Trackable Status Stats (GET)
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.
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/)
```
var accessToken = ""; //Required
var caption = ""; //Required
var description = ""; //Required
var imageurl = ""; //Required
var status = ""; //Required
var title = ""; //Required
var url = ""; //Required
LoginRadiusSDK.socialApi.getTrackableStatusStats(accessToken, caption, description, imageurl, status, title, url, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Refresh User Profile (GET)
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](https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/refresh-user-profile)
```
var accessToken = ""; //Required
var fields = null; //Optional
LoginRadiusSDK.socialApi.getRefreshedSocialUserProfile(accessToken, fields, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Video (GET)
The Video API is used to get video files data from the user's social account.
Supported Providers: Facebook, Google, Live, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/video)
```
var accessToken = ""; //Required
var nextCursor = ""; //Required
LoginRadiusSDK.socialApi.getVideos(accessToken, nextCursor, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
### CustomObject API
List of APIs in this Section:
* PUT : [Custom Object Update by Access Token](#UpdateCustomObjectByToken-put-)
* POST : [Create Custom Object by Token](#CreateCustomObjectByToken-post-)
* GET : [Custom Object by Token](#GetCustomObjectByToken-get-)
* GET : [Custom Object by ObjectRecordId and Token](#GetCustomObjectByRecordIDAndToken-get-)
* DELETE : [Custom Object Delete by Record Id And Token](#DeleteCustomObjectByToken-delete-)
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)
```
var accessToken = ""; //Required
var objectName = ""; //Required
var objectRecordId = ""; //Required
var object = { "customdata1": "Store my customdata1 value" }; //Required
var updateType = ""; //Optional
LoginRadiusSDK.customObjectApi.updateCustomObjectByToken(accessToken, objectName, objectRecordId, object, updateType, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var accessToken = ""; //Required
var objectName = ""; //Required
var object = { "customdata1": "Store my customdata1 value" }; //Required
LoginRadiusSDK.customObjectApi.createCustomObjectByToken(accessToken, objectName, object, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var accessToken = ""; //Required
var objectName = ""; //Required
LoginRadiusSDK.customObjectApi.getCustomObjectByToken(accessToken, objectName, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var accessToken = ""; //Required
var objectName = ""; //Required
var objectRecordId = ""; //Required
LoginRadiusSDK.customObjectApi.getCustomObjectByRecordIDAndToken(accessToken, objectName, objectRecordId, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var accessToken = ""; //Required
var objectName = ""; //Required
var objectRecordId = ""; //Required
LoginRadiusSDK.customObjectApi.deleteCustomObjectByToken(accessToken, objectName, objectRecordId, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
### 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-)
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)
```
var resetPasswordByOTPModel ={
"otp" : "",
"password" : "",
"phone" : ""
}; //Required
LoginRadiusSDK.phoneAuthenticationApi.resetPasswordByPhoneOTP(resetPasswordByOTPModel, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var otp = ""; //Required
var phone = ""; //Required
var fields = null; //Optional
var smsTemplate = ""; //Optional
LoginRadiusSDK.phoneAuthenticationApi.phoneVerificationByOTP(otp, phone, fields, smsTemplate, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var accessToken = ""; //Required
var otp = ""; //Required
var smsTemplate = ""; //Optional
LoginRadiusSDK.phoneAuthenticationApi.phoneVerificationOTPByAccessToken(accessToken, otp, smsTemplate, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var accessToken = ""; //Required
var phone = ""; //Required
var smsTemplate = ""; //Optional
LoginRadiusSDK.phoneAuthenticationApi.updatePhoneNumber(accessToken, phone, smsTemplate, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var phoneAuthenticationModel ={
"password" : "",
"phone" : ""
}; //Required
var fields = null; //Optional
var loginUrl = ""; //Optional
var smsTemplate = ""; //Optional
LoginRadiusSDK.phoneAuthenticationApi.loginByPhone(phoneAuthenticationModel, fields, loginUrl, smsTemplate, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var phone = ""; //Required
var smsTemplate = ""; //Optional
LoginRadiusSDK.phoneAuthenticationApi.forgotPasswordByPhoneOTP(phone, smsTemplate, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var phone = ""; //Required
var smsTemplate = ""; //Optional
LoginRadiusSDK.phoneAuthenticationApi.phoneResendVerificationOTP(phone, smsTemplate, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var accessToken = ""; //Required
var phone = ""; //Required
var smsTemplate = ""; //Optional
LoginRadiusSDK.phoneAuthenticationApi.phoneResendVerificationOTPByToken(accessToken, phone, smsTemplate, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var authUserRegistrationModel ={
"firstName" : "",
"lastName" : "",
"password" : "",
"phoneId" : ""
}; //Required
var sott = ""; //Required
var fields = null; //Optional
var options = ""; //Optional
var smsTemplate = ""; //Optional
var verificationUrl = ""; //Optional
var welcomeEmailTemplate = ""; //Optional
LoginRadiusSDK.phoneAuthenticationApi.userRegistrationByPhone(authUserRegistrationModel, sott, fields, options, smsTemplate, verificationUrl, welcomeEmailTemplate, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var phone = ""; //Required
LoginRadiusSDK.phoneAuthenticationApi.checkPhoneNumberAvailability(phone, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var accessToken = ""; //Required
LoginRadiusSDK.phoneAuthenticationApi.removePhoneIDByAccessToken(accessToken, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
### MultiFactorAuthentication API
List of APIs in this Section:
* PUT : [Update MFA Setting](#MFAUpdateSetting-put-)
* PUT : [Update MFA by Access Token](#MFAUpdateByAccessToken-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 Google Auth Code](#MFAValidateGoogleAuthCode-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-)
* 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-)
* DELETE : [MFA Reset Google Authenticator by Token](#MFAResetGoogleAuthByToken-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-)
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/)
```
var accessToken = ""; //Required
var multiFactorAuthModelWithLockout ={
"otp" : ""
}; //Required
var fields = null; //Optional
LoginRadiusSDK.multiFactorAuthenticationApi.mfaUpdateSetting(accessToken, multiFactorAuthModelWithLockout, fields, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
Update MFA by Access Token (PUT)
This API is used to Enable Multi-factor authentication by access token on user login [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/google-authenticator/update-mfa-by-access-token/)
```
var accessToken = ""; //Required
var multiFactorAuthModelByGoogleAuthenticatorCode ={
"googleAuthenticatorCode" : ""
}; //Required
var fields = null; //Optional
var smsTemplate = ""; //Optional
LoginRadiusSDK.multiFactorAuthenticationApi.mfaUpdateByAccessToken(accessToken, multiFactorAuthModelByGoogleAuthenticatorCode, fields, smsTemplate, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var accessToken = ""; //Required
var phoneNo2FA = ""; //Required
var smsTemplate2FA = ""; //Optional
LoginRadiusSDK.multiFactorAuthenticationApi.mfaUpdatePhoneNumberByToken(accessToken, phoneNo2FA, smsTemplate2FA, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var accessToken = ""; //Required
var multiFactorAuthModelByEmailOtpWithLockout ={
"EmailId":"emailId",
"Otp":"otp"
}; //Required
LoginRadiusSDK.multiFactorAuthenticationApi.mfaValidateEmailOtpByAccessToken(accessToken, multiFactorAuthModelByEmailOtpWithLockout, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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)
```
var accessToken = ""; //Required
var securityQuestionAnswerModelByAccessToken ={
"securityquestionanswer": [
{
"QuestionId": "db7****8a73e4******bd9****8c20",
"Answer": ""
}
],
"ReplaceSecurityQuestionAnswer":true
}; //Required
LoginRadiusSDK.multiFactorAuthenticationApi.mfaSecurityQuestionAnswerByAccessToken(accessToken, securityQuestionAnswerModelByAccessToken, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var multiFactorAuthModelWithLockout ={
"otp" : ""
}; //Required
var secondFactorAuthenticationToken = ""; //Required
var fields = null; //Optional
var rbaBrowserEmailTemplate = ""; //Optional
var rbaCityEmailTemplate = ""; //Optional
var rbaCountryEmailTemplate = ""; //Optional
var rbaIpEmailTemplate = ""; //Optional
var smsTemplate2FA = ""; //Optional
LoginRadiusSDK.multiFactorAuthenticationApi.mfaValidateOTPByPhone(multiFactorAuthModelWithLockout, secondFactorAuthenticationToken, fields, rbaBrowserEmailTemplate, rbaCityEmailTemplate, rbaCountryEmailTemplate, rbaIpEmailTemplate, smsTemplate2FA, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
MFA Validate Google Auth Code (PUT)
This API is used to login via Multi-factor-authentication by passing the google authenticator code. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/google-authenticator/mfa-validate-google-auth-code/)
```
var googleAuthenticatorCode = ""; //Required
var secondFactorAuthenticationToken = ""; //Required
var fields = null; //Optional
var rbaBrowserEmailTemplate = ""; //Optional
var rbaCityEmailTemplate = ""; //Optional
var rbaCountryEmailTemplate = ""; //Optional
var rbaIpEmailTemplate = ""; //Optional
LoginRadiusSDK.multiFactorAuthenticationApi.mfaValidateGoogleAuthCode(googleAuthenticatorCode, secondFactorAuthenticationToken, fields, rbaBrowserEmailTemplate, rbaCityEmailTemplate, rbaCountryEmailTemplate, rbaIpEmailTemplate, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var multiFactorAuthModelByBackupCode ={
"backupCode" : ""
}; //Required
var secondFactorAuthenticationToken = ""; //Required
var fields = null; //Optional
var rbaBrowserEmailTemplate = ""; //Optional
var rbaCityEmailTemplate = ""; //Optional
var rbaCountryEmailTemplate = ""; //Optional
var rbaIpEmailTemplate = ""; //Optional
LoginRadiusSDK.multiFactorAuthenticationApi.mfaValidateBackupCode(multiFactorAuthModelByBackupCode, secondFactorAuthenticationToken, fields, rbaBrowserEmailTemplate, rbaCityEmailTemplate, rbaCountryEmailTemplate, rbaIpEmailTemplate, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var phoneNo2FA = ""; //Required
var secondFactorAuthenticationToken = ""; //Required
var smsTemplate2FA = ""; //Optional
LoginRadiusSDK.multiFactorAuthenticationApi.mfaUpdatePhoneNumber(phoneNo2FA, secondFactorAuthenticationToken, smsTemplate2FA, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var multiFactorAuthModelByEmailOtp ={
"EmailId":"emailId",
"Otp":"otp"
}; //Required
var secondFactorAuthenticationToken = ""; //Required
var rbaBrowserEmailTemplate = ""; //Optional
var rbaCityEmailTemplate = ""; //Optional
var rbaCountryEmailTemplate = ""; //Optional
var rbaIpEmailTemplate = ""; //Optional
LoginRadiusSDK.multiFactorAuthenticationApi.mfaValidateEmailOtp(multiFactorAuthModelByEmailOtp, secondFactorAuthenticationToken, rbaBrowserEmailTemplate, rbaCityEmailTemplate, rbaCountryEmailTemplate, rbaIpEmailTemplate, function(error, data){
if(error){
console.log(error);
return;
}
console.log(data);
});
```
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/)
```
var securityQuestionAnswerUpdateModel ={
"securityquestionanswer": [
{
"QuestionId": "db7****8a73e4******bd9****8c20",
"Answer": ""
}
]
}; //Required
var secondFactorAuthenticationToken = "