https://github.com/loginradius/java-sdk
The LoginRadius Java library will let you integrate LoginRadius' customer identity platform with your Java application(s).
https://github.com/loginradius/java-sdk
customer-registration hacktoberfest java-library java-sdk library-wrapper loginradius loginradius-platform maven-plugin social-login user-registration
Last synced: 9 months ago
JSON representation
The LoginRadius Java library will let you integrate LoginRadius' customer identity platform with your Java application(s).
- Host: GitHub
- URL: https://github.com/loginradius/java-sdk
- Owner: LoginRadius
- License: mit
- Created: 2012-07-14T18:42:18.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2024-07-09T09:22:18.000Z (over 1 year ago)
- Last Synced: 2024-07-10T10:53:15.201Z (over 1 year ago)
- Topics: customer-registration, hacktoberfest, java-library, java-sdk, library-wrapper, loginradius, loginradius-platform, maven-plugin, social-login, user-registration
- Language: Java
- Homepage: http://www.loginradius.com
- Size: 8.69 MB
- Stars: 10
- Watchers: 8
- Forks: 19
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# LoginRadius Java SDK
LoginRadius Customer Identity and Access Management SDK for Java

## Introduction ##
LoginRadius Java Customer Registration wrapper provides access to LoginRadius Identity Management 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 User Registration. You can gather a wealth of user profile data from Social Login or Traditional User Registration.
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.
# Installing
LoginRadius is now using Maven. At present the jars *are* available from a public [maven]( http://search.maven.org/#search%7Cga%7C1%7Cloginradius) repository.
Use the following dependency in your project:
```xml
com.loginradius.sdk
java-sdk
11.6.0
```
The jars are also available [here](http://search.maven.org/#search%7Cga%7C1%7Cloginradius). Select the directory for
the latest version and download the jar files.
## Documentation
Java 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
This documentation presumes you have worked through the client-side implementation to setup your LoginRadius User Registration interfaces that will service the initial registration and login process. Details on this can be found in the [getting started guide.](https://www.loginradius.com/docs/api/v2/getting-started/introduction)
Use the following dependency in your project:
You can also compile the source by running the following commands. This will generate the javadocs in java-sdk/target/apidocs
`$ git clone https://github.com/LoginRadius/java-sdk.git`
`$ cd java-sdk`
`$ mvn install ` # Requires maven, download from http://maven.apache.org/download.html
`$ mvn dependency:copy-dependencies` # This will generate all dependencies here: java-sdk/target/dependency
The jars are also available at [Maven](https://mvnrepository.com/artifact/com.loginradius.sdk/java-sdk).
Select the directory for the latest version and download the jar files.
## Initialize SDK
Before using the SDK, you must initialize the SDK with the help API Key and secret of your LoginRadius site. 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-key-and-secret)
```java
LoginRadiusSDK.Initialize init = new LoginRadiusSDK.Initialize();
init.setApiKey("");
init.setApiSecret("");
```
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.
```java
init.setOriginIp("");
```
### Custom Domain
When initializing the SDK, optionally specify a custom domain.
```java
init.setCustomDomain("");
```
### API Request Signing
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.
```java
init.setRequestSigning(true);
```
### Connection Time out
You can optionally specify custom connections timeouts
```java
init.setConnectionTimeout(15000); //set connection timeout in millisecond
```
### Read Time out
You can optionally specify custom Read timeouts
```java
init.setReadTimeout(15000); //set read timeout in millisecond
```
### Proxy
When making requests to the LoginRadius API, you may also o set the proxy for your web requests so that requests made to api.loginradius.com will be processed by your proxy.
```java
init.setProxyHost("");
init.setProxyPort("");
init.setProxyUserName("");
init.setProxyPassword("");
```
## Quickstart Guide
The User Registration system relies on two identifiers which you can retrieve as follows:
Pass the token returned in the User Registration login response to the code behind. You can use a javascript function in the login and sociallogin onSuccess functions. Additional details on setting up and configuring your interface is available [here](https://www.loginradius.com/docs/api/v2/deployment/js-libraries/getting-started/#user-registration-getting-started). You can set the action in the redirect function to the desired servlet or .jsp.
```java
function redirect(token) {
var form = document.createElement("form");
form.method = "POST";
form.action = "Profile.jsp";
var _token = document.createElement("input");
_token.type = "hidden";
_token.name = "token";
_token.value = token;
form.appendChild(_token);
document.body.appendChild(form);
form.submit();
}
```
### SOTT Configuration
Sott class that uses 256-bit AES encryption which is not supported by Java out of the box,
Before calling the class of SOTT you need to install the JCE unlimited strength jars in the security folder.
* To apply the policy files:
1. Download the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files from Oracle.
Be sure to download the correct policy file updates for your version of Java:
Java 6
http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html
java 7
http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
java 8
http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
2. Uncompress and extract the downloaded file. The download includes a Readme.txt and two .jar files with the same names as the existing policy files.
3. Locate the two existing policy files:
local_policy.jar
US_export_policy.jar
On UNIX, look in /lib/security/
On Windows, look in C:/Program Files/Java/jre/lib/security/
4. Replace the existing policy files with the unlimited strength policy files you extracted.
* After complete the configuration, use below code to get the SOTT.
* By default, the SOTT expiration time will be 10 minutes if you use the below code.
```java
Sott sott = new Sott();
String sottResponse = sott.getSott(null);
```
* If you want to validate your SOTT for long term then pass required timedifference in minutes.
* We recommend to set `getLrServerTime=true`for generating manual SOTT for a long term because it uses the server time not your system local time.
```java
ServiceSottInfo serviceSottInfo=new ServiceSottInfo();
serviceSottInfo.setTimeDifference(""); // (Optional) The time difference will be used to set the expiration time of SOTT, If you do not pass time difference then the default expiration time of SOTT is 10 minutes.
ServiceInfoModel service=new ServiceInfoModel();
service.setSott(serviceSottInfo);
//The LoginRadius API key and primary API secret can be passed additionally, If the credentials will not be passed then this SOTT function will pick the API credentials from the SDK configuration.
String apiKey="";//(Optional) LoginRadius Api Key.
String apiSecret="";//(Optional) LoginRadius Api Secret (Only Primary Api Secret is used to generate the SOTT manually).
boolean getLrServerTime=true;//(Optional) If true it will call LoginRadius Get Server Time Api and fetch basic server information and server time information which is useful when generating an SOTT token.
try {
String sottResponse = Sott.getSott(service,apiKey,apiSecret,getLrServerTime);
System.out.println("sott = " + sottResponse);
} catch (Exception e) {
e.printStackTrace();
}
```
### 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-)
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/)
```Java
String accessToken = ""; //Required
UserProfileUpdateModel userProfileUpdateModel = new UserProfileUpdateModel(); //Required
userProfileUpdateModel.setFirstName("firstName");
userProfileUpdateModel.setLastName("lastName");
String emailTemplate = ""; //Optional
String fields = null; //Optional
String smsTemplate = ""; //Optional
String verificationUrl = ""; //Optional
Boolean isVoiceOtp = false; //Optional
String options = ""; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.updateProfileByAccessToken(accessToken, userProfileUpdateModel, emailTemplate, fields, smsTemplate, verificationUrl, isVoiceOtp , options , new AsyncHandler> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse response) {
System.out.println(response.getIsPosted());
}
});
```
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/)
```java
String accessToken = ""; //Required
UnlockProfileModel unlockProfileModel = new UnlockProfileModel(); //Required
unlockProfileModel.setG_Recaptcha_Response("g-recaptcha-response");
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.unlockAccountByToken(accessToken, unlockProfileModel , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
```
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/)
```java
EmailVerificationByOtpModel emailVerificationByOtpModel = new EmailVerificationByOtpModel(); //Required
emailVerificationByOtpModel.setEmail("email");
emailVerificationByOtpModel.setOtp("otp");
String fields = null; //Optional
String url = ""; //Optional
String welcomeEmailTemplate = ""; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.verifyEmailByOTP( emailVerificationByOtpModel, fields, url, welcomeEmailTemplate , new AsyncHandler>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse> response) {
System.out.println(response.getIsPosted());
}
});
```
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)
```java
ResetPasswordBySecurityAnswerAndEmailModel resetPasswordBySecurityAnswerAndEmailModel = new ResetPasswordBySecurityAnswerAndEmailModel(); //Required
resetPasswordBySecurityAnswerAndEmailModel.setEmail("email");
resetPasswordBySecurityAnswerAndEmailModel.setPassword("password");
Map securityAnswer= new HashMap ();
securityAnswer.put("", "" );
resetPasswordBySecurityAnswerAndEmailModel.setSecurityAnswer(securityAnswer);
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.resetPasswordBySecurityAnswerAndEmail( resetPasswordBySecurityAnswerAndEmailModel , new AsyncHandler> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse response) {
System.out.println(response.getIsPosted());
}
});
```
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)
```java
ResetPasswordBySecurityAnswerAndPhoneModel resetPasswordBySecurityAnswerAndPhoneModel = new ResetPasswordBySecurityAnswerAndPhoneModel(); //Required
resetPasswordBySecurityAnswerAndPhoneModel.setPassword("password");
resetPasswordBySecurityAnswerAndPhoneModel.setPhone("phone");
Map securityAnswer= new HashMap ();
securityAnswer.put("", "" );
resetPasswordBySecurityAnswerAndPhoneModel.setSecurityAnswer(securityAnswer);
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.resetPasswordBySecurityAnswerAndPhone( resetPasswordBySecurityAnswerAndPhoneModel , new AsyncHandler> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse response) {
System.out.println(response.getIsPosted());
}
});
```
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)
```java
ResetPasswordBySecurityAnswerAndUserNameModel resetPasswordBySecurityAnswerAndUserNameModel = new ResetPasswordBySecurityAnswerAndUserNameModel(); //Required
resetPasswordBySecurityAnswerAndUserNameModel.setPassword("password");
Map securityAnswer= new HashMap ();
securityAnswer.put("", "" );
resetPasswordBySecurityAnswerAndUserNameModel.setSecurityAnswer(securityAnswer);
resetPasswordBySecurityAnswerAndUserNameModel.setUserName("userName");
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.resetPasswordBySecurityAnswerAndUserName( resetPasswordBySecurityAnswerAndUserNameModel , new AsyncHandler> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse response) {
System.out.println(response.getIsPosted());
}
});
```
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)
```java
ResetPasswordByResetTokenModel resetPasswordByResetTokenModel = new ResetPasswordByResetTokenModel(); //Required
resetPasswordByResetTokenModel.setPassword("password");
resetPasswordByResetTokenModel.setResetToken("resetToken");
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.resetPasswordByResetToken( resetPasswordByResetTokenModel , new AsyncHandler> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse response) {
System.out.println(response.getIsPosted());
}
});
```
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)
```java
ResetPasswordByEmailAndOtpModel resetPasswordByEmailAndOtpModel = new ResetPasswordByEmailAndOtpModel(); //Required
resetPasswordByEmailAndOtpModel.setEmail("email");
resetPasswordByEmailAndOtpModel.setOtp("otp");
resetPasswordByEmailAndOtpModel.setPassword("password");
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.resetPasswordByEmailOTP( resetPasswordByEmailAndOtpModel , new AsyncHandler> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse response) {
System.out.println(response.getIsPosted());
}
});
```
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/)
```java
ResetPasswordByUserNameModel resetPasswordByUserNameModel = new ResetPasswordByUserNameModel(); //Required
resetPasswordByUserNameModel.setOtp("otp");
resetPasswordByUserNameModel.setPassword("password");
resetPasswordByUserNameModel.setUserName("userName");
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.resetPasswordByOTPAndUserName( resetPasswordByUserNameModel , new AsyncHandler> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse response) {
System.out.println(response.getIsPosted());
}
});
```
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)
```java
String accessToken = ""; //Required
String newPassword = ""; //Required
String oldPassword = ""; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.changePassword(accessToken, newPassword, oldPassword , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
```
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/)
```java
String accessToken = ""; //Required
String username = ""; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.setOrChangeUserName(accessToken, username , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
```
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/)
```java
String email = ""; //Required
String emailTemplate = ""; //Optional
String verificationUrl = ""; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.authResendEmailVerification(email, emailTemplate, verificationUrl , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
```
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)
```java
String accessToken = ""; //Required
String email = ""; //Required
String type = ""; //Required
String emailTemplate = ""; //Optional
String verificationUrl = ""; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.addEmail(accessToken, email, type, emailTemplate, verificationUrl , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
```
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)
```java
EmailAuthenticationModel emailAuthenticationModel = new EmailAuthenticationModel(); //Required
emailAuthenticationModel.setEmail("email");
emailAuthenticationModel.setPassword("password");
String emailTemplate = ""; //Optional
String fields = null; //Optional
String loginUrl = ""; //Optional
String verificationUrl = ""; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.loginByEmail( emailAuthenticationModel, emailTemplate, fields, loginUrl, verificationUrl , new AsyncHandler> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken response) {
System.out.println(response.getAccess_Token());
}
});
```
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)
```java
UserNameAuthenticationModel userNameAuthenticationModel = new UserNameAuthenticationModel(); //Required
userNameAuthenticationModel.setPassword("password");
userNameAuthenticationModel.setUsername("username");
String emailTemplate = ""; //Optional
String fields = null; //Optional
String loginUrl = ""; //Optional
String verificationUrl = ""; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.loginByUserName( userNameAuthenticationModel, emailTemplate, fields, loginUrl, verificationUrl , new AsyncHandler> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken response) {
System.out.println(response.getAccess_Token());
}
});
```
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)
```java
String email = ""; //Required
String resetPasswordUrl = ""; //Required
String emailTemplate = ""; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.forgotPassword(email, resetPasswordUrl, emailTemplate , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
```
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)
```java
String accessToken = ""; //Required
String candidateToken = ""; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.linkSocialIdentities(accessToken, candidateToken , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
```
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)
```java
String accessToken = ""; //Required
String clientGuid = ""; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.linkSocialIdentitiesByPing(accessToken, clientGuid , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
```
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)
```Java
AuthUserRegistrationModel authUserRegistrationModel = new AuthUserRegistrationModel(); //Required
List email = new ArrayList < EmailModel >();
EmailModel emailModel = new EmailModel();
emailModel.setType("type");
emailModel.setValue("value");
email.add(emailModel);
authUserRegistrationModel.setEmail(email);
authUserRegistrationModel.setFirstName("firstName");
authUserRegistrationModel.setLastName("lastName");
authUserRegistrationModel.setPassword("password");
String sott = ""; //Required
String emailTemplate = ""; //Optional
String fields = null; //Optional
String options = ""; //Optional
String verificationUrl = ""; //Optional
String welcomeEmailTemplate = ""; //Optional
Boolean isVoiceOtp = false; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.userRegistrationByEmail( authUserRegistrationModel, sott, emailTemplate, fields, options, verificationUrl, welcomeEmailTemplate, isVoiceOtp , new AsyncHandler>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse> response) {
System.out.println(response.getIsPosted());
}
});
```
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)
```Java
AuthUserRegistrationModelWithCaptcha authUserRegistrationModelWithCaptcha = new AuthUserRegistrationModelWithCaptcha(); //Required
List email = new ArrayList < EmailModel >();
EmailModel emailModel = new EmailModel();
emailModel.setType("type");
emailModel.setValue("value");
email.add(emailModel);
authUserRegistrationModelWithCaptcha.setEmail(email);
authUserRegistrationModelWithCaptcha.setFirstName("firstName");
authUserRegistrationModelWithCaptcha.setG_Recaptcha_Response("g-recaptcha-response");
authUserRegistrationModelWithCaptcha.setLastName("lastName");
authUserRegistrationModelWithCaptcha.setPassword("password");
String emailTemplate = ""; //Optional
String fields = null; //Optional
String options = ""; //Optional
String smsTemplate = ""; //Optional
String verificationUrl = ""; //Optional
String welcomeEmailTemplate = ""; //Optional
Boolean isVoiceOtp = false; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.userRegistrationByCaptcha( authUserRegistrationModelWithCaptcha, emailTemplate, fields, options, smsTemplate, verificationUrl, welcomeEmailTemplate, isVoiceOtp , new AsyncHandler>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse> response) {
System.out.println(response.getIsPosted());
}
});
```
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/)
```java
String email = ""; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.getSecurityQuestionsByEmail(email , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(SecurityQuestions[] response) {
System.out.println(response[0].getQuestion());
}
});
```
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/)
```java
String userName = ""; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.getSecurityQuestionsByUserName(userName , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(SecurityQuestions[] response) {
System.out.println(response[0].getQuestion());
}
});
```
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/)
```java
String phone = ""; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.getSecurityQuestionsByPhone(phone , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(SecurityQuestions[] response) {
System.out.println(response[0].getQuestion());
}
});
```
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/)
```java
String accessToken = ""; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.getSecurityQuestionsByAccessToken(accessToken , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(SecurityQuestions[] response) {
System.out.println(response[0].getQuestion());
}
});
```
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/)
```java
String accessToken = ""; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.authValidateAccessToken(accessToken , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_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/)
```java
String accessToken = ""; //Required
Boolean preventRefresh = true; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.authInValidateAccessToken(accessToken, preventRefresh , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
```
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/)
```java
String accessToken = ""; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.getAccessTokenInfo(accessToken , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(TokenInfoResponseModel response) {
System.out.println(response.getAccess_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/)
```java
String accessToken = ""; //Required
String fields = null; //Optional
String emailTemplate = ""; //Optional
String verificationUrl = ""; //Optional
String welcomeEmailTemplate = ""; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.getProfileByAccessToken(accessToken, fields, emailTemplate, verificationUrl, welcomeEmailTemplate , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
```
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/)
```java
String accessToken = ""; //Required
String welcomeEmailTemplate = ""; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.sendWelcomeEmail(accessToken, welcomeEmailTemplate , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
```
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/)
```java
String deletetoken = ""; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.deleteAccountByDeleteToken(deletetoken , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
```
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/)
```java
String clientGuid = ""; //Required
String emailTemplate = ""; //Optional
String fields = null; //Optional
String verificationUrl = ""; //Optional
String welcomeEmailTemplate = ""; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.getProfileByPing(clientGuid, emailTemplate, fields, verificationUrl, welcomeEmailTemplate , new AsyncHandler> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken response) {
System.out.println(response.getAccess_Token());
}
});
```
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/)
```java
String email = ""; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.checkEmailAvailability(email , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ExistResponse response) {
System.out.println(response.getIsExist());
}
});
```
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/)
```Java
String verificationToken = ""; //Required
String fields = null; //Optional
String url = ""; //Optional
String welcomeEmailTemplate = ""; //Optional
String uuid = ""; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.verifyEmail(verificationToken, fields, url, welcomeEmailTemplate , uuid, new AsyncHandler>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse> response) {
System.out.println(response.getIsPosted());
}
});
```
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/)
```java
String username = ""; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.checkUserNameAvailability(username , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ExistResponse response) {
System.out.println(response.getIsExist());
}
});
```
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)
```java
String accessToken = ""; //Required
String fields = null; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.acceptPrivacyPolicy(accessToken, fields , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
```
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/)
```java
String accessToken = ""; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.getPrivacyPolicyHistoryByAccessToken(accessToken , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PrivacyPolicyHistoryResponse response) {
System.out.println(response.getCurrent());
}
});
```
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/)
```Java
String accessToken = ""; //Required
String clientguid = ""; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.authSendVerificationEmailForLinkingSocialProfiles(accessToken, clientguid , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponseResendEmailVerification response) {
System.out.println(response.getIsPosted());
}
});
```
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/)
```java
String accessToken = ""; //Required
String deleteUrl = ""; //Optional
String emailTemplate = ""; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.deleteAccountWithEmailConfirmation(accessToken, deleteUrl, emailTemplate , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteRequestAcceptResponse response) {
System.out.println(response.getIsDeleteRequestAccepted());
}
});
```
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)
```java
String accessToken = ""; //Required
String email = ""; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.removeEmail(accessToken, email , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
```
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)
```java
String accessToken = ""; //Required
String provider = ""; //Required
String providerId = ""; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.unlinkSocialIdentities(accessToken, provider, providerId , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
```
### 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-)
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)
```java
AccountUserProfileUpdateModel accountUserProfileUpdateModel = new AccountUserProfileUpdateModel(); //Required
accountUserProfileUpdateModel.setFirstName("firstName");
accountUserProfileUpdateModel.setLastName("lastName");
String uid = ""; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.updateAccountByUid( accountUserProfileUpdateModel, uid, fields , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
```
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)
```java
String phone = ""; //Required
String uid = ""; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.updatePhoneIDByUid(phone, uid, fields , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
```
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)
```java
String password = ""; //Required
String uid = ""; //Required
AccountApi accountApi = new AccountApi();
accountApi.setAccountPasswordByUid(password, uid , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserPasswordHash response) {
System.out.println(response.getPasswordHash());
}
});
```
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)
```java
String uid = ""; //Required
String emailTemplate = ""; //Optional
String verificationUrl = ""; //Optional
AccountApi accountApi = new AccountApi();
accountApi.invalidateAccountEmailVerification(uid, emailTemplate, verificationUrl , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
```
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)
```Java
String uid = ""; //Required
String smsTemplate = ""; //Optional
Boolean isVoiceOtp = false; //Optional
AccountApi accountApi = new AccountApi();
accountApi.resetPhoneIDVerificationByUid(uid, smsTemplate, isVoiceOtp , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
```
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)
```java
UpsertEmailModel upsertEmailModel = new UpsertEmailModel(); //Required
List email = new ArrayList < EmailModel >();
EmailModel emailModel = new EmailModel();
emailModel.setType("type");
emailModel.setValue("value");
email.add(emailModel);
upsertEmailModel.setEmail(email);
String uid = ""; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.upsertEmail( upsertEmailModel, uid, fields , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
```
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/)
```java
UpdateUidModel updateUidModel = new UpdateUidModel(); //Required
updateUidModel.setNewUid("newUid");
String uid = ""; //Required
AccountApi accountApi = new AccountApi();
accountApi.accountUpdateUid( updateUidModel, uid , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
```
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)
```java
AccountCreateModel accountCreateModel = new AccountCreateModel(); //Required
List email = new ArrayList < EmailModel >();
EmailModel emailModel = new EmailModel();
emailModel.setType("type");
emailModel.setValue("value");
email.add(emailModel);
accountCreateModel.setEmail(email);
accountCreateModel.setFirstName("firstName");
accountCreateModel.setLastName("lastName");
accountCreateModel.setPassword("password");
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.createAccount( accountCreateModel, fields , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
```
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)
```java
String email = ""; //Required
String emailTemplate = ""; //Optional
String resetPasswordUrl = ""; //Optional
Boolean sendEmail = true; //Optional
AccountApi accountApi = new AccountApi();
accountApi.getForgotPasswordToken(email, emailTemplate, resetPasswordUrl, sendEmail , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ForgotPasswordResponse response) {
System.out.println(response.getForgotToken());
}
});
```
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)
```java
String email = ""; //Required
AccountApi accountApi = new AccountApi();
accountApi.getEmailVerificationToken(email , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(EmailVerificationTokenResponse response) {
System.out.println(response.getVerificationToken());
}
});
```
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/)
```Java
MultiEmailToken multiEmailToken = new MultiEmailToken(); //Required
multiEmailToken.setClientguid("clientguid");
multiEmailToken.setEmail("email");
multiEmailToken.setName("name");
multiEmailToken.setType("type");
multiEmailToken.setUid("uid");
multiEmailToken.setUserName("userName");
String tokentype = ""; //Required
AccountApi accountApi = new AccountApi();
accountApi.multipurposeEmailTokenGeneration( multiEmailToken, tokentype , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(MultiToken response) {
System.out.println(response.getExpiresIn());
}
});
```
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/)
```Java
MultiSmsOtp multiSmsOtp = new MultiSmsOtp(); //Required
multiSmsOtp.setName("name");
multiSmsOtp.setPhone("phone");
multiSmsOtp.setUid("uid");
String smsotptype = ""; //Required
AccountApi accountApi = new AccountApi();
accountApi.multipurposeSMSOTPGeneration( multiSmsOtp, smsotptype , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(MultiToken response) {
System.out.println(response.getExpiresIn());
}
});
```
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/)
```java
String uid = ""; //Required
AccountApi accountApi = new AccountApi();
accountApi.getPrivacyPolicyHistoryByUid(uid , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PrivacyPolicyHistoryResponse response) {
System.out.println(response.getCurrent());
}
});
```
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)
```java
String email = ""; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.getAccountProfileByEmail(email, fields , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
```
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)
```java
String userName = ""; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.getAccountProfileByUserName(userName, fields , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
```
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/)
```java
String phone = ""; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.getAccountProfileByPhone(phone, fields , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
```
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)
```java
String uid = ""; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.getAccountProfileByUid(uid, fields , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
```
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)
```java
String uid = ""; //Required
AccountApi accountApi = new AccountApi();
accountApi.getAccountPasswordHashByUid(uid , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserPasswordHash response) {
System.out.println(response.getPasswordHash());
}
});
```
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)
```java
String uid = ""; //Required
AccountApi accountApi = new AccountApi();
accountApi.getAccessTokenByUid(uid , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_Token());
}
});
```
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)
```java
String refreshToken = ""; //Required
AccountApi accountApi = new AccountApi();
accountApi.refreshAccessTokenByRefreshToken(refreshToken , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_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)
```java
String refreshToken = ""; //Required
AccountApi accountApi = new AccountApi();
accountApi.revokeRefreshToken(refreshToken , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
```
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)
```java
String email = ""; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.getAccountIdentitiesByEmail(email, fields , new AsyncHandler> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ListReturn response) {
System.out.println(response.getData().get(0).getUid());
}
});
```
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)
```java
String uid = ""; //Required
AccountApi accountApi = new AccountApi();
accountApi.deleteAccountByUid(uid , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
```
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)
```java
String email = ""; //Required
String uid = ""; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.removeEmail(email, uid, fields , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
```
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/)
```Java
String uid = ""; //Required
AccountApi accountApi = new AccountApi();
accountApi.revokeAllRefreshToken(uid , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
```
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/)
```java
String email = ""; //Required
AccountApi accountApi = new AccountApi();
accountApi.accountDeleteByEmail(email , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
```
### 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-)
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)
```java
String token = ""; //Required
SocialApi socialApi = new SocialApi();
socialApi.exchangeAccessToken(token , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_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)
```java
String accessToken = ""; //Required
Integer expiresIn = 0; //Optional
Boolean isWeb = true; //Optional
SocialApi socialApi = new SocialApi();
socialApi.refreshAccessToken(accessToken, expiresIn, isWeb , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_Token());
}
});
```
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)
```java
String accessToken = ""; //Required
SocialApi socialApi = new SocialApi();
socialApi.validateAccessToken(accessToken , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_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)
```java
String accessToken = ""; //Required
SocialApi socialApi = new SocialApi();
socialApi.inValidateAccessToken(accessToken , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostMethodResponseBase response) {
System.out.println(response.getIsPosted());
}
});
```
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)
```java
String token = ""; //Required
SocialApi socialApi = new SocialApi();
socialApi.getActiveSession(token , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserActiveSession response) {
System.out.println(response.getData().get(0).getAccessToken());
}
});
```
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/)
```java
String accountId = ""; //Required
SocialApi socialApi = new SocialApi();
socialApi.getActiveSessionByAccountID(accountId , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserActiveSession response) {
System.out.println(response.getData().get(0).getAccessToken());
}
});
```
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/)
```java
String profileId = ""; //Required
SocialApi socialApi = new SocialApi();
socialApi.getActiveSessionByProfileID(profileId , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserActiveSession response) {
System.out.println(response.getData().get(0).getAccessToken());
}
});
```
### 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-)
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)
```java
String accessToken = ""; //Required
String objectName = ""; //Required
String objectRecordId = ""; //Required
JsonObject json = new JsonObject(); //Required
json.addProperty("field1", "Store my field1 value");
CustomObjectUpdateOperationType updateType = CustomObjectUpdateOperationType.PartialReplace; //Optional
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.updateCustomObjectByToken(accessToken, objectName, objectRecordId, json, updateType , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserCustomObjectData response) {
System.out.println(response.getCustomObject());
}
});
```
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)
```java
String objectName = ""; //Required
String objectRecordId = ""; //Required
JsonObject json = new JsonObject(); //Required
json.addProperty("field1", "Store my field1 value");
String uid = ""; //Required
CustomObjectUpdateOperationType updateType = CustomObjectUpdateOperationType.PartialReplace; //Optional
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.updateCustomObjectByUid(objectName, objectRecordId, json, uid, updateType , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserCustomObjectData response) {
System.out.println(response.getCustomObject());
}
});
```
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)
```java
String accessToken = ""; //Required
String objectName = ""; //Required
JsonObject json = new JsonObject(); //Required
json.addProperty("field1", "Store my field1 value");
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.createCustomObjectByToken(accessToken, objectName, json , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserCustomObjectData response) {
System.out.println(response.getCustomObject());
}
});
```
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)
```java
String objectName = ""; //Required
JsonObject json = new JsonObject(); //Required
json.addProperty("field1", "Store my field1 value");
String uid = ""; //Required
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.createCustomObjectByUid(objectName, json, uid , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserCustomObjectData response) {
System.out.println(response.getCustomObject());
}
});
```
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)
```java
String accessToken = ""; //Required
String objectName = ""; //Required
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.getCustomObjectByToken(accessToken, objectName , new AsyncHandler> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ListData response) {
System.out.println(response.getCount());
}
});
```
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)
```java
String accessToken = ""; //Required
String objectName = ""; //Required
String objectRecordId = ""; //Required
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.getCustomObjectByRecordIDAndToken(accessToken, objectName, objectRecordId , new AsyncHandler (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserCustomObjectData response) {
System.out.println(response.getCustomObject());
}
});
```
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)
```java
String objectName = ""; //Required
String uid = ""; //Required
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.getCustomObjectByUid(objectName, uid , new AsyncHandler> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ListData