JAVA SDK
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.
Note: You must have JAVA JDK 8 or JDK 11 installed on your system.
SDK Installation and Configuration
Once the project is downloaded, the folder structure is like this.
.project
pom.xml
README.md
src
| -- main
| -- |--- |java/
| -- |--- |resources/
| -- |--- |-- application.properties
| -- |--- |-- static
| -- |--- |-- templates
| -- |--- |-- --- index.html
| -- |--- |-- --- profile.html
Add this snippet in pom.xml
<dependency>
<groupId>com.loginradius.sdk</groupId>
<artifactId>java-sdk</artifactId>
<version>11.0.1</version>
</dependency>
LoginRadius is now using Maven. The jars are also available here on the Maven repository. Select the directory for the latest version and download the jar files.
For more information on SDK configuration and obtaining API credentials, refer to this tutorial.
API Methods
Similar to the above example, you can use other API Methods to implement more features.
You can utilize these methods to implement features covered in your subscribed plan.
Below is the list of APIs with sample use of respective API Method:
Authentication API
List of APIs in this Section:
- PUT : Auth Update Profile by Token
- PUT : Auth Unlock Account by Access Token
- PUT : Auth Verify Email By OTP
- PUT : Auth Reset Password by Security Answer and Email
- PUT : Auth Reset Password by Security Answer and Phone
- PUT : Auth Reset Password by Security Answer and UserName
- PUT : Auth Reset Password by Reset Token
- PUT : Auth Reset Password by OTP
- PUT : Auth Reset Password by OTP and UserName
- PUT : Auth Change Password
- PUT : Auth Set or Change UserName
- PUT : Auth Resend Email Verification
- POST : Auth Add Email
- POST : Auth Login by Email
- POST : Auth Login by Username
- POST : Auth Forgot Password
- POST : Auth Link Social Identities
- POST : Auth Link Social Identities By Ping
- POST : Auth User Registration by Email
- POST : Auth User Registration By Captcha
- GET : Get Security Questions By Email
- GET : Get Security Questions By UserName
- GET : Get Security Questions By Phone
- GET : Get Security Questions By Access Token
- GET : Auth Validate Access token
- GET : Access Token Invalidate
- GET : Access Token Info
- GET : Auth Read all Profiles by Token
- GET : Auth Send Welcome Email
- GET : Auth Delete Account
- GET : Auth Check Email Availability
- GET : Auth Verify Email
- GET : Auth Check UserName Availability
- GET : Auth Privacy Policy Accept
- GET : Auth Privacy Policy History By Access Token
- DELETE : Auth Delete Account with Email Confirmation
- DELETE : Auth Remove Email
- DELETE : Auth Unlink Social Identities
Auth Update Profile by Token (PUT)
This API is used to update the user's profile by passing the access token.String accessToken = "<accessToken>"; //Required
UserProfileUpdateModel userProfileUpdateModel = new UserProfileUpdateModel(); //Required
userProfileUpdateModel.setFirstName("firstName");
userProfileUpdateModel.setLastName("lastName");
String emailTemplate = "<emailTemplate>"; //Optional
String fields = null; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.updateProfileByAccessToken(accessToken, userProfileUpdateModel, emailTemplate, fields, smsTemplate, verificationUrl , new AsyncHandler<UserProfilePostResponse<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<Identity> 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.String accessToken = "<accessToken>"; //Required
UnlockProfileModel unlockProfileModel = new UnlockProfileModel(); //Required
unlockProfileModel.setG_Recaptcha_Response("g-recaptcha-response");
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.unlockAccountByToken(accessToken, unlockProfileModel , new AsyncHandler<PostResponse> (){
@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.EmailVerificationByOtpModel emailVerificationByOtpModel = new EmailVerificationByOtpModel(); //Required
emailVerificationByOtpModel.setEmail("email");
emailVerificationByOtpModel.setOtp("otp");
String fields = null; //Optional
String url = "<url>"; //Optional
String welcomeEmailTemplate = "<welcomeEmailTemplate>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.verifyEmailByOTP( emailVerificationByOtpModel, fields, url, welcomeEmailTemplate , new AsyncHandler<UserProfilePostResponse<EmailVerificationData<Identity>>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<EmailVerificationData<Identity>> 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.ResetPasswordBySecurityAnswerAndEmailModel resetPasswordBySecurityAnswerAndEmailModel = new ResetPasswordBySecurityAnswerAndEmailModel(); //Required
resetPasswordBySecurityAnswerAndEmailModel.setEmail("email");
resetPasswordBySecurityAnswerAndEmailModel.setPassword("password");
Map<String,String> securityAnswer= new HashMap<String,String> ();
securityAnswer.put("<security-qustion-id>", "<security-answer>" );
resetPasswordBySecurityAnswerAndEmailModel.setSecurityAnswer(securityAnswer);
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.resetPasswordBySecurityAnswerAndEmail( resetPasswordBySecurityAnswerAndEmailModel , new AsyncHandler<UserProfilePostResponse<AccessTokenBase>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<AccessTokenBase> 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.ResetPasswordBySecurityAnswerAndPhoneModel resetPasswordBySecurityAnswerAndPhoneModel = new ResetPasswordBySecurityAnswerAndPhoneModel(); //Required
resetPasswordBySecurityAnswerAndPhoneModel.setPassword("password");
resetPasswordBySecurityAnswerAndPhoneModel.setPhone("phone");
Map<String,String> securityAnswer= new HashMap<String,String> ();
securityAnswer.put("<security-qustion-id>", "<security-answer>" );
resetPasswordBySecurityAnswerAndPhoneModel.setSecurityAnswer(securityAnswer);
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.resetPasswordBySecurityAnswerAndPhone( resetPasswordBySecurityAnswerAndPhoneModel , new AsyncHandler<UserProfilePostResponse<AccessTokenBase>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<AccessTokenBase> 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.ResetPasswordBySecurityAnswerAndUserNameModel resetPasswordBySecurityAnswerAndUserNameModel = new ResetPasswordBySecurityAnswerAndUserNameModel(); //Required
resetPasswordBySecurityAnswerAndUserNameModel.setPassword("password");
Map<String,String> securityAnswer= new HashMap<String,String> ();
securityAnswer.put("<security-qustion-id>", "<security-answer>" );
resetPasswordBySecurityAnswerAndUserNameModel.setSecurityAnswer(securityAnswer);
resetPasswordBySecurityAnswerAndUserNameModel.setUserName("userName");
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.resetPasswordBySecurityAnswerAndUserName( resetPasswordBySecurityAnswerAndUserNameModel , new AsyncHandler<UserProfilePostResponse<AccessTokenBase>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<AccessTokenBase> 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.ResetPasswordByResetTokenModel resetPasswordByResetTokenModel = new ResetPasswordByResetTokenModel(); //Required
resetPasswordByResetTokenModel.setPassword("password");
resetPasswordByResetTokenModel.setResetToken("resetToken");
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.resetPasswordByResetToken( resetPasswordByResetTokenModel , new AsyncHandler<UserProfilePostResponse<AccessTokenBase>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<AccessTokenBase> 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.ResetPasswordByEmailAndOtpModel resetPasswordByEmailAndOtpModel = new ResetPasswordByEmailAndOtpModel(); //Required
resetPasswordByEmailAndOtpModel.setEmail("email");
resetPasswordByEmailAndOtpModel.setOtp("otp");
resetPasswordByEmailAndOtpModel.setPassword("password");
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.resetPasswordByEmailOTP( resetPasswordByEmailAndOtpModel , new AsyncHandler<UserProfilePostResponse<AccessTokenBase>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<AccessTokenBase> 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.ResetPasswordByUserNameModel resetPasswordByUserNameModel = new ResetPasswordByUserNameModel(); //Required
resetPasswordByUserNameModel.setOtp("otp");
resetPasswordByUserNameModel.setPassword("password");
resetPasswordByUserNameModel.setUserName("userName");
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.resetPasswordByOTPAndUserName( resetPasswordByUserNameModel , new AsyncHandler<UserProfilePostResponse<AccessTokenBase>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<AccessTokenBase> response) {
System.out.println(response.getIsPosted());
}
});
Auth Change Password (PUT)
This API is used to change the accounts password based on the previous password.String accessToken = "<accessToken>"; //Required
String newPassword = "<newPassword>"; //Required
String oldPassword = "<oldPassword>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.changePassword(accessToken, newPassword, oldPassword , new AsyncHandler<PostResponse> (){
@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.String accessToken = "<accessToken>"; //Required
String username = "<username>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.setOrChangeUserName(accessToken, username , new AsyncHandler<PostResponse> (){
@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.String email = "<email>"; //Required
String emailTemplate = "<emailTemplate>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.authResendEmailVerification(email, emailTemplate, verificationUrl , new AsyncHandler<PostResponse> (){
@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.String accessToken = "<accessToken>"; //Required
String email = "<email>"; //Required
String type = "<type>"; //Required
String emailTemplate = "<emailTemplate>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.addEmail(accessToken, email, type, emailTemplate, verificationUrl , new AsyncHandler<PostResponse> (){
@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.EmailAuthenticationModel emailAuthenticationModel = new EmailAuthenticationModel(); //Required
emailAuthenticationModel.setEmail("email");
emailAuthenticationModel.setPassword("password");
String emailTemplate = "<emailTemplate>"; //Optional
String fields = null; //Optional
String loginUrl = "<loginUrl>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.loginByEmail( emailAuthenticationModel, emailTemplate, fields, loginUrl, verificationUrl , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> 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.UserNameAuthenticationModel userNameAuthenticationModel = new UserNameAuthenticationModel(); //Required
userNameAuthenticationModel.setPassword("password");
userNameAuthenticationModel.setUsername("username");
String emailTemplate = "<emailTemplate>"; //Optional
String fields = null; //Optional
String loginUrl = "<loginUrl>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.loginByUserName( userNameAuthenticationModel, emailTemplate, fields, loginUrl, verificationUrl , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> 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'.String email = "<email>"; //Required
String resetPasswordUrl = "<resetPasswordUrl>"; //Required
String emailTemplate = "<emailTemplate>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.forgotPassword(email, resetPasswordUrl, emailTemplate , new AsyncHandler<PostResponse> (){
@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.String accessToken = "<accessToken>"; //Required
String candidateToken = "<candidateToken>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.linkSocialIdentities(accessToken, candidateToken , new AsyncHandler<PostResponse> (){
@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.String accessToken = "<accessToken>"; //Required
String clientGuid = "<clientGuid>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.linkSocialIdentitiesByPing(accessToken, clientGuid , new AsyncHandler<PostResponse> (){
@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.AuthUserRegistrationModel authUserRegistrationModel = new AuthUserRegistrationModel(); //Required
List<EmailModel> 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 = "<sott>"; //Required
String emailTemplate = "<emailTemplate>"; //Optional
String fields = null; //Optional
String options = "<options>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
String welcomeEmailTemplate = "<welcomeEmailTemplate>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.userRegistrationByEmail( authUserRegistrationModel, sott, emailTemplate, fields, options, verificationUrl, welcomeEmailTemplate , new AsyncHandler<UserProfilePostResponse<AccessToken<Identity>>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<AccessToken<Identity>> 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.AuthUserRegistrationModelWithCaptcha authUserRegistrationModelWithCaptcha = new AuthUserRegistrationModelWithCaptcha(); //Required
List<EmailModel> 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 = "<emailTemplate>"; //Optional
String fields = null; //Optional
String options = "<options>"; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
String welcomeEmailTemplate = "<welcomeEmailTemplate>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.userRegistrationByCaptcha( authUserRegistrationModelWithCaptcha, emailTemplate, fields, options, smsTemplate, verificationUrl, welcomeEmailTemplate , new AsyncHandler<UserProfilePostResponse<AccessToken<Identity>>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<AccessToken<Identity>> 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.String email = "<email>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.getSecurityQuestionsByEmail(email , new AsyncHandler<SecurityQuestions[]> (){
@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.String userName = "<userName>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.getSecurityQuestionsByUserName(userName , new AsyncHandler<SecurityQuestions[]> (){
@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.String phone = "<phone>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.getSecurityQuestionsByPhone(phone , new AsyncHandler<SecurityQuestions[]> (){
@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.String accessToken = "<accessToken>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.getSecurityQuestionsByAccessToken(accessToken , new AsyncHandler<SecurityQuestions[]> (){
@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.String accessToken = "<accessToken>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.authValidateAccessToken(accessToken , new AsyncHandler<AccessTokenBase> (){
@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.String accessToken = "<accessToken>"; //Required
Boolean preventRefresh = true; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.authInValidateAccessToken(accessToken, preventRefresh , new AsyncHandler<PostResponse> (){
@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.String accessToken = "<accessToken>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.getAccessTokenInfo(accessToken , new AsyncHandler<TokenInfoResponseModel> (){
@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.String accessToken = "<accessToken>"; //Required
String fields = null; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.getProfileByAccessToken(accessToken, fields , new AsyncHandler<Identity> (){
@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.String accessToken = "<accessToken>"; //Required
String welcomeEmailTemplate = "<welcomeEmailTemplate>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.sendWelcomeEmail(accessToken, welcomeEmailTemplate , new AsyncHandler<PostResponse> (){
@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.String deletetoken = "<deletetoken>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.deleteAccountByDeleteToken(deletetoken , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
Auth Check Email Availability (GET)
This API is used to check the email exists or not on your site.String email = "<email>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.checkEmailAvailability(email , new AsyncHandler<ExistResponse> (){
@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'.String verificationToken = "<verificationToken>"; //Required
String fields = null; //Optional
String url = "<url>"; //Optional
String welcomeEmailTemplate = "<welcomeEmailTemplate>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.verifyEmail(verificationToken, fields, url, welcomeEmailTemplate , new AsyncHandler<UserProfilePostResponse<EmailVerificationData<Identity>>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<EmailVerificationData<Identity>> 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.String username = "<username>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.checkUserNameAvailability(username , new AsyncHandler<ExistResponse> (){
@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.String accessToken = "<accessToken>"; //Required
String fields = null; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.acceptPrivacyPolicy(accessToken, fields , new AsyncHandler<Identity> (){
@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. ```java@Override public void onFailure(ErrorResponse errorResponse) { System.out.println(errorResponse.getDescription()); } @Override public void onSuccess(PrivacyPolicyHistoryResponse response) { System.out.println(response.getCurrent().getVersion()); } });
<h4 id="DeleteAccountWithEmailConfirmation-delete-">Auth Delete Account with Email Confirmation (DELETE)</h4>
This API will send a confirmation email for account deletion to the customer's email when passed the customer's access token.
```java
String accessToken = "<accessToken>"; //Required
String deleteUrl = "<deleteUrl>"; //Optional
String emailTemplate = "<emailTemplate>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.deleteAccountWithEmailConfirmation(accessToken, deleteUrl, emailTemplate , new AsyncHandler<DeleteRequestAcceptResponse> (){
@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.String accessToken = "<accessToken>"; //Required
String email = "<email>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.removeEmail(accessToken, email , new AsyncHandler<DeleteResponse> (){
@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.String accessToken = "<accessToken>"; //Required
String provider = "<provider>"; //Required
String providerId = "<providerId>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.unlinkSocialIdentities(accessToken, provider, providerId , new AsyncHandler<DeleteResponse> (){
@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
- PUT : Update Phone ID by UID
- PUT : Account Set Password
- PUT : Account Invalidate Verification Email
- PUT : Reset phone ID verification
- PUT : Upsert Email
- POST : Account Create
- POST : Forgot Password token
- POST : Email Verification token
- GET : Get Privacy Policy History By Uid
- GET : Account Profiles by Email
- GET : Account Profiles by Username
- GET : Account Profile by Phone ID
- GET : Account Profiles by UID
- GET : Account Password
- GET : Access Token based on UID or User impersonation API
- GET : Refresh Access Token by Refresh Token
- GET : Revoke Refresh Token
- GET : Account Identities by Email
- DELETE : Account Delete
- DELETE : Account Remove Email
- DELETE : Delete User Profiles By Email
Account Update (PUT)
This API is used to update the information of existing accounts in your Cloud Storage. See our Advanced API Usage section.AccountUserProfileUpdateModel accountUserProfileUpdateModel = new AccountUserProfileUpdateModel(); //Required
accountUserProfileUpdateModel.setFirstName("firstName");
accountUserProfileUpdateModel.setLastName("lastName");
String uid = "<uid>"; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.updateAccountByUid( accountUserProfileUpdateModel, uid, fields , new AsyncHandler<Identity> (){
@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.String phone = "<phone>"; //Required
String uid = "<uid>"; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.updatePhoneIDByUid(phone, uid, fields , new AsyncHandler<Identity> (){
@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.String password = "<password>"; //Required
String uid = "<uid>"; //Required
AccountApi accountApi = new AccountApi();
accountApi.setAccountPasswordByUid(password, uid , new AsyncHandler<UserPasswordHash> (){
@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.String uid = "<uid>"; //Required
String emailTemplate = "<emailTemplate>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
AccountApi accountApi = new AccountApi();
accountApi.invalidateAccountEmailVerification(uid, emailTemplate, verificationUrl , new AsyncHandler<PostResponse> (){
@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.String uid = "<uid>"; //Required
String smsTemplate = "<smsTemplate>"; //Optional
AccountApi accountApi = new AccountApi();
accountApi.resetPhoneIDVerificationByUid(uid, smsTemplate , new AsyncHandler<PostResponse> (){
@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.UpsertEmailModel upsertEmailModel = new UpsertEmailModel(); //Required
List<EmailModel> email = new ArrayList < EmailModel >();
EmailModel emailModel = new EmailModel();
emailModel.setType("type");
emailModel.setValue("value");
email.add(emailModel);
upsertEmailModel.setEmail(email);
String uid = "<uid>"; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.upsertEmail( upsertEmailModel, uid, fields , new AsyncHandler<Identity> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
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.
AccountCreateModel accountCreateModel = new AccountCreateModel(); //Required
List<EmailModel> 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<Identity> (){
@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.String email = "<email>"; //Required
String emailTemplate = "<emailTemplate>"; //Optional
String resetPasswordUrl = "<resetPasswordUrl>"; //Optional
Boolean sendEmail = true; //Optional
AccountApi accountApi = new AccountApi();
accountApi.getForgotPasswordToken(email, emailTemplate, resetPasswordUrl, sendEmail , new AsyncHandler<ForgotPasswordResponse> (){
@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.String email = "<email>"; //Required
AccountApi accountApi = new AccountApi();
accountApi.getEmailVerificationToken(email , new AsyncHandler<EmailVerificationTokenResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(EmailVerificationTokenResponse response) {
System.out.println(response.getVerificationToken());
}
});
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.String uid = "<uid>"; //Required
AccountApi accountApi = new AccountApi();
accountApi.getPrivacyPolicyHistoryByUid(uid , new AsyncHandler<PrivacyPolicyHistoryResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PrivacyPolicyHistoryResponse response) {
System.out.println(response.getCurrent().getVersion());
}
});
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.String email = "<email>"; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.getAccountProfileByEmail(email, fields , new AsyncHandler<Identity> (){
@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.String userName = "<userName>"; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.getAccountProfileByUserName(userName, fields , new AsyncHandler<Identity> (){
@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.String phone = "<phone>"; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.getAccountProfileByPhone(phone, fields , new AsyncHandler<Identity> (){
@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.String uid = "<uid>"; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.getAccountProfileByUid(uid, fields , new AsyncHandler<Identity> (){
@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.String uid = "<uid>"; //Required
AccountApi accountApi = new AccountApi();
accountApi.getAccountPasswordHashByUid(uid , new AsyncHandler<UserPasswordHash> (){
@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.String uid = "<uid>"; //Required
AccountApi accountApi = new AccountApi();
accountApi.getAccessTokenByUid(uid , new AsyncHandler<AccessTokenBase> (){
@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.String refreshToken = "<refreshToken>"; //Required
AccountApi accountApi = new AccountApi();
accountApi.refreshAccessTokenByRefreshToken(refreshToken , new AsyncHandler<AccessTokenBase> (){
@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.String refreshToken = "<refreshToken>"; //Required
AccountApi accountApi = new AccountApi();
accountApi.revokeRefreshToken(refreshToken , new AsyncHandler<DeleteResponse> (){
@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.String email = "<email>"; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.getAccountIdentitiesByEmail(email, fields , new AsyncHandler<ListReturn<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ListReturn<Identity> 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.String uid = "<uid>"; //Required
AccountApi accountApi = new AccountApi();
accountApi.deleteAccountByUid(uid , new AsyncHandler<DeleteResponse> (){
@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.String email = "<email>"; //Required
String uid = "<uid>"; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.removeEmail(email, uid, fields , new AsyncHandler<Identity> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
Delete User Profiles By Email (DELETE)
This API is used to delete all user profiles associated with an Email.String email = "<email>"; //Required
AccountApi accountApi = new AccountApi();
accountApi.accountDeleteByEmail(email , new AsyncHandler<DeleteResponse> (){
@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:
- POST : Post Message API
- POST : Status Posting
- POST : Trackable Status Posting
- GET : Access Token
- GET : Refresh Token
- GET : Token Validate
- GET : Access Token Invalidate
- GET : Get Active Session Details
- GET : Get Active Session By Account Id
- GET : Get Active Session By Profile Id
- GET : Album
- GET : Get Albums with cursor
- GET : Audio
- GET : Get Audio With Cursor
- GET : Check In
- GET : Get CheckIns With Cursor
- GET : Contact
- GET : Event
- GET : Get Events With Cursor
- GET : Following
- GET : Get Followings With Cursor
- GET : Group
- GET : Get Groups With Cursor
- GET : Like
- GET : Get Likes With Cursor
- GET : Mention
- GET : Page
- GET : Photo
- GET : Get Post
- GET : Get Trackable Status Stats
- GET : Trackable Status Fetching
- GET : User Profile
- GET : Refresh User Profile
- GET : Video
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.
String accessToken = "<accessToken>"; //Required
String message = "<message>"; //Required
String subject = "<subject>"; //Required
String to = "<to>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.postMessage(accessToken, message, subject, to , new AsyncHandler<PostMethodResponseBase> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostMethodResponseBase response) {
System.out.println(response.getIsPosted());
}
});
Status Posting (POST)
The Status API is used to update the status on the user's wall.Supported Providers: Facebook, Twitter, LinkedIn.
String accessToken = "<accessToken>"; //Required
String caption = "<caption>"; //Required
String description = "<description>"; //Required
String imageurl = "<imageurl>"; //Required
String status = "<status>"; //Required
String title = "<title>"; //Required
String url = "<url>"; //Required
String shorturl = "<shorturl>"; //Optional
SocialApi socialApi = new SocialApi();
socialApi.statusPosting(accessToken, caption, description, imageurl, status, title, url, shorturl , new AsyncHandler<PostMethodResponse<ShortUrlResponse>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostMethodResponse<ShortUrlResponse> response) {
System.out.println(response.getIsPosted());
}
});
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.
String accessToken = "<accessToken>"; //Required
StatusModel statusModel = new StatusModel(); //Required
statusModel.setCaption("caption");
statusModel.setDescription("description");
statusModel.setImageurl("imageurl");
statusModel.setStatus("status");
statusModel.setTitle("title");
statusModel.setUrl("url");
SocialApi socialApi = new SocialApi();
socialApi.trackableStatusPosting(accessToken, statusModel , new AsyncHandler<StatusUpdateResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(StatusUpdateResponse response) {
System.out.println(response.getId());
}
});
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. ```java@Override public void onFailure(ErrorResponse errorResponse) { System.out.println(errorResponse.getDescription()); } @Override public void onSuccess(AccessTokenBase response) { System.out.println(response.getAccess_Token()); } });
<h4 id="RefreshAccessToken-get-">Refresh Token (GET)</h4>
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.<br><br><b>Supported Providers :</b> Facebook,Yahoo,Google,Twitter, Linkedin.<br><br> Contact LoginRadius support team to enable this API.
```java
String accessToken = "<accessToken>"; //Required
Integer expiresIn = 0; //Optional
Boolean isWeb = true; //Optional
SocialApi socialApi = new SocialApi();
socialApi.refreshAccessToken(accessToken, expiresIn, isWeb , new AsyncHandler<AccessTokenBase> (){
@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.String accessToken = "<accessToken>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.validateAccessToken(accessToken , new AsyncHandler<AccessTokenBase> (){
@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.String accessToken = "<accessToken>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.inValidateAccessToken(accessToken , new AsyncHandler<PostMethodResponseBase> (){
@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.String token = "<token>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getActiveSession(token , new AsyncHandler<UserActiveSession> (){
@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). ```java@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()); } });
<h4 id="GetActiveSessionByProfileID-get-">Get Active Session By Profile Id (GET)</h4>
This api is used to get all active sessions by ProfileId.
```java
String profileId = "<profileId>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getActiveSessionByProfileID(profileId , new AsyncHandler<UserActiveSession> (){
@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());
}
});
Album (GET)
Supported Providers: Facebook, Google, Live, Vkontakte.This API returns the photo albums associated with the passed in access tokens Social Profile.
String accessToken = "<accessToken>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getAlbums(accessToken , new AsyncHandler<Album[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Album[] response) {
System.out.println(response[0].getCoverImageUrl());
}
});
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.
String accessToken = "<accessToken>"; //Required
String nextCursor = "<nextCursor>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getAlbumsWithCursor(accessToken, nextCursor , new AsyncHandler<CursorResponse<Album>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(CursorResponse<Album> response) {
System.out.println(response.getData().get(0).getCoverImageUrl());
}
});
Audio (GET)
The Audio API is used to get audio files data from the user's social account.Supported Providers: Live, Vkontakte.
String accessToken = "<accessToken>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getAudios(accessToken , new AsyncHandler<Audio[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Audio[] response) {
System.out.println(response[0].getArtist());
}
});
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 .
String accessToken = "<accessToken>"; //Required
String nextCursor = "<nextCursor>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getAudiosWithCursor(accessToken, nextCursor , new AsyncHandler<CursorResponse<Audio>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(CursorResponse<Audio> response) {
System.out.println(response.getData().get(0).getArtist());
}
});
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.
String accessToken = "<accessToken>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getCheckIns(accessToken , new AsyncHandler<CheckIn[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(CheckIn[] response) {
System.out.println(response[0].getAddress());
}
});
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.
String accessToken = "<accessToken>"; //Required
String nextCursor = "<nextCursor>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getCheckInsWithCursor(accessToken, nextCursor , new AsyncHandler<CursorResponse<CheckIn>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(CursorResponse<CheckIn> response) {
System.out.println(response.getData().get(0).getAddress());
}
});
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.
String accessToken = "<accessToken>"; //Required
String nextCursor = "<nextCursor>"; //Optional
SocialApi socialApi = new SocialApi();
socialApi.getContacts(accessToken, nextCursor , new AsyncHandler<CursorResponse<Contact>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(CursorResponse<Contact> response) {
System.out.println(response.getData().get(0).getCountry());
}
});
Event (GET)
The Event API is used to get the event data from the user's social account.Supported Providers: Facebook, Live.
String accessToken = "<accessToken>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getEvents(accessToken , new AsyncHandler<Events[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Events[] response) {
System.out.println(response[0].getDescription());
}
});
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
String accessToken = "<accessToken>"; //Required
String nextCursor = "<nextCursor>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getEventsWithCursor(accessToken, nextCursor , new AsyncHandler<CursorResponse<Events>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(CursorResponse<Events> response) {
System.out.println(response.getData().get(0).getDescription());
}
});
Following (GET)
Get the following user list from the user's social account.Supported Providers: Twitter
String accessToken = "<accessToken>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getFollowings(accessToken , new AsyncHandler<Contact[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Contact[] response) {
System.out.println(response[0].getCountry());
}
});
Get Followings With Cursor (GET)
Get the following user list from the user's social account.Supported Providers: Twitter
String accessToken = "<accessToken>"; //Required
String nextCursor = "<nextCursor>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getFollowingsWithCursor(accessToken, nextCursor , new AsyncHandler<CursorResponse<Contact>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(CursorResponse<Contact> response) {
System.out.println(response.getData().get(0).getCountry());
}
});
Group (GET)
The Group API is used to get group data from the user's social account.Supported Providers: Facebook, Vkontakte
String accessToken = "<accessToken>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getGroups(accessToken , new AsyncHandler<Group[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Group[] response) {
System.out.println(response[0].getCountry());
}
});
Get Groups With Cursor (GET)
The Group API is used to get group data from the user's social account.Supported Providers: Facebook, Vkontakte
String accessToken = "<accessToken>"; //Required
String nextCursor = "<nextCursor>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getGroupsWithCursor(accessToken, nextCursor , new AsyncHandler<CursorResponse<Group>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(CursorResponse<Group> response) {
System.out.println(response.getData().get(0).getCountry());
}
});
Like (GET)
The Like API is used to get likes data from the user's social account.Supported Providers: Facebook
String accessToken = "<accessToken>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getLikes(accessToken , new AsyncHandler<Like[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Like[] response) {
System.out.println(response[0].getCategory());
}
});
Get Likes With Cursor (GET)
The Like API is used to get likes data from the user's social account.Supported Providers: Facebook ```java
<h4 id="GetMentions-get-">Mention (GET)</h4>
The Mention API is used to get mentions data from the user's social account.<br><br><b>Supported Providers:</b> Twitter
```java
String accessToken = "<accessToken>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getMentions(accessToken , new AsyncHandler<Status[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Status[] response) {
System.out.println(response[0].getDateTime());
}
});
Page (GET)
The Page API is used to get the page data from the user's social account.Supported Providers: Facebook, LinkedIn
String accessToken = "<accessToken>"; //Required
String pageName = "<pageName>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getPage(accessToken, pageName , new AsyncHandler<Page> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Page response) {
System.out.println(response.getAbout());
}
});
Photo (GET)
The Photo API is used to get photo data from the user's social account.Supported Providers: Facebook, Foursquare, Google, Live, Vkontakte
String accessToken = "<accessToken>"; //Required
String albumId = "<albumId>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getPhotos(accessToken, albumId , new AsyncHandler<Photo[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Photo[] response) {
System.out.println(response[0].getAlbumId());
}
});
Get Post (GET)
The Post API is used to get post message data from the user's social account.Supported Providers: Facebook
String accessToken = "<accessToken>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getPosts(accessToken , new AsyncHandler<Post[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Post[] response) {
System.out.println(response[0].getID());
}
});
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.
String accessToken = "<accessToken>"; //Required
String caption = "<caption>"; //Required
String description = "<description>"; //Required
String imageurl = "<imageurl>"; //Required
String status = "<status>"; //Required
String title = "<title>"; //Required
String url = "<url>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getTrackableStatusStats(accessToken, caption, description, imageurl, status, title, url , new AsyncHandler<StatusUpdateResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(StatusUpdateResponse response) {
System.out.println(response.getId());
}
});
Trackable Status Fetching (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.This API is used to retrieve a tracked post based on the passed in post ID value. This API requires setting permissions in your LoginRadius Dashboard.
Note: To utilize this API you need to find the ID for the post you want to track, which might require using Trackable Status Posting API first.
String postId = "<postId>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.trackableStatusFetching(postId , new AsyncHandler<StatusUpdateStats> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(StatusUpdateStats response) {
System.out.println(response.getComments());
}
});
User Profile (GET)
The User Profile API is used to get social profile data from the user's social account after authentication.Supported Providers: All
String accessToken = "<accessToken>"; //Required
String fields = null; //Optional
SocialApi socialApi = new SocialApi();
socialApi.getSocialUserProfile(accessToken, fields , new AsyncHandler<UserProfile> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfile response) {
System.out.println(response.getFirstName());
}
});
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.String accessToken = "<accessToken>"; //Required
String fields = null; //Optional
SocialApi socialApi = new SocialApi();
socialApi.getRefreshedSocialUserProfile(accessToken, fields , new AsyncHandler<UserProfile> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfile response) {
System.out.println(response.getFirstName());
}
});
Video (GET)
The Video API is used to get video files data from the user's social account.Supported Providers: Facebook, Google, Live, Vkontakte
String accessToken = "<accessToken>"; //Required
String nextCursor = "<nextCursor>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getVideos(accessToken, nextCursor , new AsyncHandler<CursorResponse<Video>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(CursorResponse<Video> response) {
System.out.println(response.getData().get(0).getCreatedDate());
}
});
CustomObject API
List of APIs in this Section:
- PUT : Custom Object Update by Access Token
- PUT : Custom Object Update by UID
- POST : Create Custom Object by Token
- POST : Create Custom Object by UID
- GET : Custom Object by Token
- GET : Custom Object by ObjectRecordId and Token
- GET : Custom Object By UID
- GET : Custom Object by ObjectRecordId and UID
- DELETE : Custom Object Delete by Record Id And Token
- DELETE : Account Delete Custom Object by ObjectRecordId
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 operationString accessToken = "<accessToken>"; //Required
String objectName = "<objectName>"; //Required
String objectRecordId = "<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<UserCustomObjectData> (){
@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.String objectName = "<objectName>"; //Required
String objectRecordId = "<objectRecordId>"; //Required
JsonObject json = new JsonObject(); //Required
json.addProperty("field1", "Store my field1 value");
String uid = "<uid>"; //Required
CustomObjectUpdateOperationType updateType = CustomObjectUpdateOperationType.PartialReplace; //Optional
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.updateCustomObjectByUid(objectName, objectRecordId, json, uid, updateType , new AsyncHandler<UserCustomObjectData> (){
@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.String accessToken = "<accessToken>"; //Required
String objectName = "<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<UserCustomObjectData> (){
@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.String objectName = "<objectName>"; //Required
JsonObject json = new JsonObject(); //Required
json.addProperty("field1", "Store my field1 value");
String uid = "<uid>"; //Required
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.createCustomObjectByUid(objectName, json, uid , new AsyncHandler<UserCustomObjectData> (){
@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.String accessToken = "<accessToken>"; //Required
String objectName = "<objectName>"; //Required
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.getCustomObjectByToken(accessToken, objectName , new AsyncHandler<ListData<UserCustomObjectData>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ListData<UserCustomObjectData> 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.String accessToken = "<accessToken>"; //Required
String objectName = "<objectName>"; //Required
String objectRecordId = "<objectRecordId>"; //Required
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.getCustomObjectByRecordIDAndToken(accessToken, objectName, objectRecordId , new AsyncHandler<UserCustomObjectData> (){
@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.String objectName = "<objectName>"; //Required
String uid = "<uid>"; //Required
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.getCustomObjectByUid(objectName, uid , new AsyncHandler<ListData<UserCustomObjectData>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ListData<UserCustomObjectData> response) {
System.out.println(response.getCount());
}
});
Custom Object by ObjectRecordId and UID (GET)
This API is used to retrieve the Custom Object data for the specified account.String objectName = "<objectName>"; //Required
String objectRecordId = "<objectRecordId>"; //Required
String uid = "<uid>"; //Required
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.getCustomObjectByRecordID(objectName, objectRecordId, uid , new AsyncHandler<UserCustomObjectData> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserCustomObjectData response) {
System.out.println(response.getCustomObject());
}
});
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.String accessToken = "<accessToken>"; //Required
String objectName = "<objectName>"; //Required
String objectRecordId = "<objectRecordId>"; //Required
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.deleteCustomObjectByToken(accessToken, objectName, objectRecordId , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
Account Delete Custom Object by ObjectRecordId (DELETE)
This API is used to remove the specified Custom Object data using ObjectRecordId of specified account.String objectName = "<objectName>"; //Required
String objectRecordId = "<objectRecordId>"; //Required
String uid = "<uid>"; //Required
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.deleteCustomObjectByRecordID(objectName, objectRecordId, uid , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
PhoneAuthentication API
List of APIs in this Section:
- PUT : Phone Reset Password by OTP
- PUT : Phone Verification OTP
- PUT : Phone Verification OTP by Token
- PUT : Phone Number Update
- POST : Phone Login
- POST : Phone Forgot Password by OTP
- POST : Phone Resend Verification OTP
- POST : Phone Resend Verification OTP By Token
- POST : Phone User Registration by SMS
- GET : Phone Number Availability
- DELETE : Remove Phone ID by Access Token
Phone Reset Password by OTP (PUT)
This API is used to reset the passwordResetPasswordByOTPModel resetPasswordByOTPModel = new ResetPasswordByOTPModel(); //Required
resetPasswordByOTPModel.setOtp("otp");
resetPasswordByOTPModel.setPassword("password");
resetPasswordByOTPModel.setPhone("phone");
PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi();
phoneAuthenticationApi.resetPasswordByPhoneOTP( resetPasswordByOTPModel , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
Phone Verification OTP (PUT)
This API is used to validate the verification code sent to verify a user's phone numberString otp = "<otp>"; //Required
String phone = "<phone>"; //Required
String fields = null; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi();
phoneAuthenticationApi.phoneVerificationByOTP(otp, phone, fields, smsTemplate , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
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.String accessToken = "<accessToken>"; //Required
String otp = "<otp>"; //Required
String smsTemplate = "<smsTemplate>"; //Optional
PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi();
phoneAuthenticationApi.phoneVerificationOTPByAccessToken(accessToken, otp, smsTemplate , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
Phone Number Update (PUT)
This API is used to update the login Phone Number of usersString accessToken = "<accessToken>"; //Required
String phone = "<phone>"; //Required
String smsTemplate = "<smsTemplate>"; //Optional
PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi();
phoneAuthenticationApi.updatePhoneNumber(accessToken, phone, smsTemplate , new AsyncHandler<UserProfilePostResponse<SMSResponseData>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<SMSResponseData> response) {
System.out.println(response.getIsPosted());
}
});
Phone Login (POST)
This API retrieves a copy of the user data based on the PhonePhoneAuthenticationModel phoneAuthenticationModel = new PhoneAuthenticationModel(); //Required
phoneAuthenticationModel.setPassword("password");
phoneAuthenticationModel.setPhone("phone");
String fields = null; //Optional
String loginUrl = "<loginUrl>"; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi();
phoneAuthenticationApi.loginByPhone( phoneAuthenticationModel, fields, loginUrl, smsTemplate , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
Phone Forgot Password by OTP (POST)
This API is used to send the OTP to reset the account password.String phone = "<phone>"; //Required
String smsTemplate = "<smsTemplate>"; //Optional
PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi();
phoneAuthenticationApi.forgotPasswordByPhoneOTP(phone, smsTemplate , new AsyncHandler<UserProfilePostResponse<SMSResponseData>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<SMSResponseData> response) {
System.out.println(response.getIsPosted());
}
});
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 inputString phone = "<phone>"; //Required
String smsTemplate = "<smsTemplate>"; //Optional
PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi();
phoneAuthenticationApi.phoneResendVerificationOTP(phone, smsTemplate , new AsyncHandler<UserProfilePostResponse<SMSResponseData>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<SMSResponseData> response) {
System.out.println(response.getIsPosted());
}
});
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 existsString accessToken = "<accessToken>"; //Required
String phone = "<phone>"; //Required
String smsTemplate = "<smsTemplate>"; //Optional
PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi();
phoneAuthenticationApi.phoneResendVerificationOTPByToken(accessToken, phone, smsTemplate , new AsyncHandler<UserProfilePostResponse<SMSResponseData>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<SMSResponseData> response) {
System.out.println(response.getIsPosted());
}
});
Phone User Registration by SMS (POST)
This API registers the new users into your Cloud Storage and triggers the phone verification process.AuthUserRegistrationModel authUserRegistrationModel = new AuthUserRegistrationModel(); //Required
authUserRegistrationModel.setFirstName("firstName");
authUserRegistrationModel.setLastName("lastName");
authUserRegistrationModel.setPassword("password");
authUserRegistrationModel.setPhoneId("phoneId");
String sott = "<sott>"; //Required
String fields = null; //Optional
String options = "<options>"; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
String welcomeEmailTemplate = "<welcomeEmailTemplate>"; //Optional
PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi();
phoneAuthenticationApi.userRegistrationByPhone( authUserRegistrationModel, sott, fields, options, smsTemplate, verificationUrl, welcomeEmailTemplate , new AsyncHandler<UserProfilePostResponse<AccessToken<Identity>>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<AccessToken<Identity>> response) {
System.out.println(response.getIsPosted());
}
});
Phone Number Availability (GET)
This API is used to check the Phone Number exists or not on your site.String phone = "<phone>"; //Required
PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi();
phoneAuthenticationApi.checkPhoneNumberAvailability(phone , new AsyncHandler<ExistResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ExistResponse response) {
System.out.println(response.getIsExist());
}
});
Remove Phone ID by Access Token (DELETE)
This API is used to delete the Phone ID on a user's account via the access tokenString accessToken = "<accessToken>"; //Required
PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi();
phoneAuthenticationApi.removePhoneIDByAccessToken(accessToken , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
MultiFactorAuthentication API
List of APIs in this Section:
- PUT : Update MFA Setting
- PUT : Update MFA by Access Token
- PUT : MFA Update Phone Number by Token
- PUT : MFA Validate OTP
- PUT : MFA Validate Google Auth Code
- PUT : MFA Validate Backup code
- PUT : MFA Update Phone Number
- POST : MFA Email Login
- POST : MFA UserName Login
- POST : MFA Phone Login
- GET : MFA Validate Access Token
- GET : MFA Backup Code by Access Token
- GET : Reset Backup Code by Access Token
- GET : MFA Resend Otp
- GET : MFA Backup Code by UID
- GET : MFA Reset Backup Code by UID
- DELETE : MFA Reset Google Authenticator by Token
- DELETE : MFA Reset SMS Authenticator by Token
- DELETE : MFA Reset SMS Authenticator By UID
- DELETE : MFA Reset Google Authenticator By UID
Update MFA Setting (PUT)
This API is used to trigger the Multi-factor authentication settings after login for secure actionsString accessToken = "<accessToken>"; //Required
MultiFactorAuthModelWithLockout multiFactorAuthModelWithLockout = new MultiFactorAuthModelWithLockout(); //Required
multiFactorAuthModelWithLockout.setOtp("otp");
String fields = null; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaUpdateSetting(accessToken, multiFactorAuthModelWithLockout, fields , new AsyncHandler<Identity> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
Update MFA by Access Token (PUT)
This API is used to Enable Multi-factor authentication by access token on user loginString accessToken = "<accessToken>"; //Required
MultiFactorAuthModelByGoogleAuthenticatorCode multiFactorAuthModelByGoogleAuthenticatorCode = new MultiFactorAuthModelByGoogleAuthenticatorCode(); //Required
multiFactorAuthModelByGoogleAuthenticatorCode.setGoogleAuthenticatorCode("googleAuthenticatorCode");
String fields = null; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaUpdateByAccessToken(accessToken, multiFactorAuthModelByGoogleAuthenticatorCode, fields, smsTemplate , new AsyncHandler<Identity> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
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 numberString accessToken = "<accessToken>"; //Required
String phoneNo2FA = "<phoneNo2FA>"; //Required
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaUpdatePhoneNumberByToken(accessToken, phoneNo2FA, smsTemplate2FA , new AsyncHandler<SMSResponseData> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(SMSResponseData response) {
System.out.println(response.getAccountSid());
}
});
MFA Validate OTP (PUT)
This API is used to login via Multi-factor authentication by passing the One Time Password received via SMSMultiFactorAuthModelWithLockout multiFactorAuthModelWithLockout = new MultiFactorAuthModelWithLockout(); //Required
multiFactorAuthModelWithLockout.setOtp("otp");
String secondFactorAuthenticationToken = "<secondFactorAuthenticationToken>"; //Required
String fields = null; //Optional
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaValidateOTPByPhone( multiFactorAuthModelWithLockout, secondFactorAuthenticationToken, fields, smsTemplate2FA , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
MFA Validate Google Auth Code (PUT)
This API is used to login via Multi-factor-authentication by passing the google authenticator code.String googleAuthenticatorCode = "<googleAuthenticatorCode>"; //Required
String secondFactorAuthenticationToken = "<secondFactorAuthenticationToken>"; //Required
String fields = null; //Optional
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaValidateGoogleAuthCode(googleAuthenticatorCode, secondFactorAuthenticationToken, fields, smsTemplate2FA , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
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 automaticallyMultiFactorAuthModelByBackupCode multiFactorAuthModelByBackupCode = new MultiFactorAuthModelByBackupCode(); //Required
multiFactorAuthModelByBackupCode.setBackupCode("backupCode");
String secondFactorAuthenticationToken = "<secondFactorAuthenticationToken>"; //Required
String fields = null; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaValidateBackupCode( multiFactorAuthModelByBackupCode, secondFactorAuthenticationToken, fields , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
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 numberString phoneNo2FA = "<phoneNo2FA>"; //Required
String secondFactorAuthenticationToken = "<secondFactorAuthenticationToken>"; //Required
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaUpdatePhoneNumber(phoneNo2FA, secondFactorAuthenticationToken, smsTemplate2FA , new AsyncHandler<SMSResponseData> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(SMSResponseData response) {
System.out.println(response.getAccountSid());
}
});
MFA Email Login (POST)
This API can be used to login by emailid on a Multi-factor authentication enabled LoginRadius site.String email = "<email>"; //Required
String password = "<password>"; //Required
String emailTemplate = "<emailTemplate>"; //Optional
String fields = null; //Optional
String loginUrl = "<loginUrl>"; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaLoginByEmail(email, password, emailTemplate, fields, loginUrl, smsTemplate, smsTemplate2FA, verificationUrl , new AsyncHandler<MultiFactorAuthenticationResponse<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(MultiFactorAuthenticationResponse<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
MFA UserName Login (POST)
This API can be used to login by username on a Multi-factor authentication enabled LoginRadius site.String password = "<password>"; //Required
String username = "<username>"; //Required
String emailTemplate = "<emailTemplate>"; //Optional
String fields = null; //Optional
String loginUrl = "<loginUrl>"; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaLoginByUserName(password, username, emailTemplate, fields, loginUrl, smsTemplate, smsTemplate2FA, verificationUrl , new AsyncHandler<MultiFactorAuthenticationResponse<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(MultiFactorAuthenticationResponse<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
MFA Phone Login (POST)
This API can be used to login by Phone on a Multi-factor authentication enabled LoginRadius site.String password = "<password>"; //Required
String phone = "<phone>"; //Required
String emailTemplate = "<emailTemplate>"; //Optional
String fields = null; //Optional
String loginUrl = "<loginUrl>"; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaLoginByPhone(password, phone, emailTemplate, fields, loginUrl, smsTemplate, smsTemplate2FA, verificationUrl , new AsyncHandler<MultiFactorAuthenticationResponse<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(MultiFactorAuthenticationResponse<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
MFA Validate Access Token (GET)
This API is used to configure the Multi-factor authentication after login by using the access token when MFA is set as optional on the LoginRadius site.String accessToken = "<accessToken>"; //Required
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaConfigureByAccessToken(accessToken, smsTemplate2FA , new AsyncHandler<MultiFactorAuthenticationSettingsResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(MultiFactorAuthenticationSettingsResponse response) {
System.out.println(response.getIsGoogleAuthenticatorVerified());
}
});
MFA Backup Code by Access Token (GET)
This API is used to get a set of backup codes via access token to allow the user login on a site that has Multi-factor Authentication enabled in the event that the user does not have a secondary factor available. We generate 10 codes, each code can only be consumed once. If any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automaticallyString accessToken = "<accessToken>"; //Required
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaBackupCodeByAccessToken(accessToken , new AsyncHandler<BackupCodeResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(BackupCodeResponse response) {
System.out.println(response.getBackUpCodes());
}
});
Reset Backup Code by Access Token (GET)
API is used to reset the backup codes on a given account via the access token. This API call will generate 10 new codes, each code can only be consumed onceString accessToken = "<accessToken>"; //Required
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaResetBackupCodeByAccessToken(accessToken , new AsyncHandler<BackupCodeResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(BackupCodeResponse response) {
System.out.println(response.getBackUpCodes());
}
});
MFA Resend Otp (GET)
This API is used to resending the verification OTP to the provided phone numberString secondFactorAuthenticationToken = "<secondFactorAuthenticationToken>"; //Required
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaResendOTP(secondFactorAuthenticationToken, smsTemplate2FA , new AsyncHandler<SMSResponseData> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(SMSResponseData response) {
System.out.println(response.getAccountSid());
}
});
MFA Backup Code by UID (GET)
This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once.String uid = "<uid>"; //Required
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaBackupCodeByUid(uid , new AsyncHandler<BackupCodeResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(BackupCodeResponse response) {
System.out.println(response.getBackUpCodes());
}
});
MFA Reset Backup Code by UID (GET)
This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once.String uid = "<uid>"; //Required
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaResetBackupCodeByUid(uid , new AsyncHandler<BackupCodeResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(BackupCodeResponse response) {
System.out.println(response.getBackUpCodes());
}
});
MFA Reset Google Authenticator by Token (DELETE)
This API Resets the Google Authenticator configurations on a given account via the access tokenString accessToken = "<accessToken>"; //Required
Boolean googleauthenticator = true; //Required
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaResetGoogleAuthByToken(accessToken, googleauthenticator , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
MFA Reset SMS Authenticator by Token (DELETE)
This API resets the SMS Authenticator configurations on a given account via the access token.String accessToken = "<accessToken>"; //Required
Boolean otpauthenticator = true; //Required
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaResetSMSAuthByToken(accessToken, otpauthenticator , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
MFA Reset SMS Authenticator By UID (DELETE)
This API resets the SMS Authenticator configurations on a given account via the UID.Boolean otpauthenticator = true; //Required
String uid = "<uid>"; //Required
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaResetSMSAuthenticatorByUid(otpauthenticator, uid , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
MFA Reset Google Authenticator By UID (DELETE)
This API resets the Google Authenticator configurations on a given account via the UID.Boolean googleauthenticator = true; //Required
String uid = "<uid>"; //Required
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaResetGoogleAuthenticatorByUid(googleauthenticator, uid , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
PINAuthentication API
List of APIs in this Section:
- PUT : Reset PIN By ResetToken
- PUT : Reset PIN By SecurityAnswer And Email
- PUT : Reset PIN By SecurityAnswer And Username
- PUT : Reset PIN By SecurityAnswer And Phone
- PUT : Change PIN By Token
- PUT : Reset PIN by Phone and OTP
- PUT : Reset PIN by Email and OTP
- PUT : Reset PIN by Username and OTP
- POST : PIN Login
- POST : Forgot PIN By Email
- POST : Forgot PIN By UserName
- POST : Forgot PIN By Phone
- POST : Set PIN By PinAuthToken
- GET : Invalidate PIN Session Token
Reset PIN By ResetToken (PUT)
This API is used to reset pin using reset token.ResetPINByResetToken resetPINByResetToken = new ResetPINByResetToken(); //Required
resetPINByResetToken.setPIN("pin");
resetPINByResetToken.setResetToken("resetToken");
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.resetPINByResetToken( resetPINByResetToken , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
Reset PIN By SecurityAnswer And Email (PUT)
This API is used to reset pin using security question answer and email.ResetPINBySecurityQuestionAnswerAndEmailModel resetPINBySecurityQuestionAnswerAndEmailModel = new ResetPINBySecurityQuestionAnswerAndEmailModel(); //Required
resetPINBySecurityQuestionAnswerAndEmailModel.setEmail("email");
resetPINBySecurityQuestionAnswerAndEmailModel.setPIN("pin");
Map<String,String> securityAnswer= new HashMap<String,String> ();
securityAnswer.put("<security-qustion-id>", "<security-answer>" );
resetPINBySecurityQuestionAnswerAndEmailModel.setSecurityAnswer(securityAnswer);
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.resetPINByEmailAndSecurityAnswer( resetPINBySecurityQuestionAnswerAndEmailModel , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
Reset PIN By SecurityAnswer And Username (PUT)
This API is used to reset pin using security question answer and username.ResetPINBySecurityQuestionAnswerAndUsernameModel resetPINBySecurityQuestionAnswerAndUsernameModel = new ResetPINBySecurityQuestionAnswerAndUsernameModel(); //Required
resetPINBySecurityQuestionAnswerAndUsernameModel.setPIN("pin");
Map<String,String> securityAnswer= new HashMap<String,String> ();
securityAnswer.put("<security-qustion-id>", "<security-answer>" );
resetPINBySecurityQuestionAnswerAndUsernameModel.setSecurityAnswer(securityAnswer);
resetPINBySecurityQuestionAnswerAndUsernameModel.setUsername("username");
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.resetPINByUsernameAndSecurityAnswer( resetPINBySecurityQuestionAnswerAndUsernameModel , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
Reset PIN By SecurityAnswer And Phone (PUT)
This API is used to reset pin using security question answer and phone.ResetPINBySecurityQuestionAnswerAndPhoneModel resetPINBySecurityQuestionAnswerAndPhoneModel = new ResetPINBySecurityQuestionAnswerAndPhoneModel(); //Required
resetPINBySecurityQuestionAnswerAndPhoneModel.setPhone("phone");
resetPINBySecurityQuestionAnswerAndPhoneModel.setPIN("pin");
Map<String,String> securityAnswer= new HashMap<String,String> ();
securityAnswer.put("<security-qustion-id>", "<security-answer>" );
resetPINBySecurityQuestionAnswerAndPhoneModel.setSecurityAnswer(securityAnswer);
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.resetPINByPhoneAndSecurityAnswer( resetPINBySecurityQuestionAnswerAndPhoneModel , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
Change PIN By Token (PUT)
This API is used to change a user's PIN using access token.String accessToken = "<accessToken>"; //Required
ChangePINModel changePINModel = new ChangePINModel(); //Required
changePINModel.setNewPIN("newPIN");
changePINModel.setOldPIN("oldPIN");
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.changePINByAccessToken(accessToken, changePINModel , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
Reset PIN by Phone and OTP (PUT)
This API is used to reset pin using phoneId and OTP.ResetPINByPhoneAndOTPModel resetPINByPhoneAndOTPModel = new ResetPINByPhoneAndOTPModel(); //Required
resetPINByPhoneAndOTPModel.setOtp("otp");
resetPINByPhoneAndOTPModel.setPhone("phone");
resetPINByPhoneAndOTPModel.setPIN("pin");
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.resetPINByPhoneAndOtp( resetPINByPhoneAndOTPModel , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
Reset PIN by Email and OTP (PUT)
This API is used to reset pin using email and OTP.ResetPINByEmailAndOtpModel resetPINByEmailAndOtpModel = new ResetPINByEmailAndOtpModel(); //Required
resetPINByEmailAndOtpModel.setEmail("email");
resetPINByEmailAndOtpModel.setOtp("otp");
resetPINByEmailAndOtpModel.setPIN("pin");
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.resetPINByEmailAndOtp( resetPINByEmailAndOtpModel , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
Reset PIN by Username and OTP (PUT)
This API is used to reset pin using username and OTP.ResetPINByUsernameAndOtpModel resetPINByUsernameAndOtpModel = new ResetPINByUsernameAndOtpModel(); //Required
resetPINByUsernameAndOtpModel.setOtp("otp");
resetPINByUsernameAndOtpModel.setPIN("pin");
resetPINByUsernameAndOtpModel.setUsername("username");
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.resetPINByUsernameAndOtp( resetPINByUsernameAndOtpModel , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
PIN Login (POST)
This API is used to login a user by pin and session token. ```java
<h4 id="SendForgotPINEmailByEmail-post-">Forgot PIN By Email (POST)</h4>
This API sends the reset pin email to specified email address.
```java
ForgotPINLinkByEmailModel forgotPINLinkByEmailModel = new ForgotPINLinkByEmailModel(); //Required
forgotPINLinkByEmailModel.setEmail("email");
String emailTemplate = "<emailTemplate>"; //Optional
String resetPINUrl = "<resetPINUrl>"; //Optional
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.sendForgotPINEmailByEmail( forgotPINLinkByEmailModel, emailTemplate, resetPINUrl , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
Forgot PIN By UserName (POST)
This API sends the reset pin email using username. ```java@Override public void onFailure(ErrorResponse errorResponse) { System.out.println(errorResponse.getDescription()); } @Override public void onSuccess(PostResponse response) { System.out.println(response.getIsPosted()); } });
<h4 id="SendForgotPINSMSByPhone-post-">Forgot PIN By Phone (POST)</h4>
This API sends the OTP to specified phone number
```java
ForgotPINOtpByPhoneModel forgotPINOtpByPhoneModel = new ForgotPINOtpByPhoneModel(); //Required
forgotPINOtpByPhoneModel.setPhone("phone");
String smsTemplate = "<smsTemplate>"; //Optional
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.sendForgotPINSMSByPhone( forgotPINOtpByPhoneModel, smsTemplate , new AsyncHandler<UserProfilePostResponse<SMSResponseData>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<SMSResponseData> response) {
System.out.println(response.getIsPosted());
}
});
Set PIN By PinAuthToken (POST)
This API is used to change a user's PIN using Pin Auth token.PINRequiredModel pinRequiredModel = new PINRequiredModel(); //Required
pinRequiredModel.setPIN("pin");
String pinAuthToken = "<pinAuthToken>"; //Required
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.setPINByPinAuthToken( pinRequiredModel, pinAuthToken , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
Invalidate PIN Session Token (GET)
This API is used to invalidate pin session token.String sessionToken = "<sessionToken>"; //Required
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.inValidatePinSessionToken(sessionToken , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
ReAuthentication API
List of APIs in this Section:
- PUT : Validate MFA by OTP
- PUT : Validate MFA by Backup Code
- PUT : Validate MFA by Google Authenticator Code
- PUT : Validate MFA by Password
- PUT : MFA Re-authentication by PIN
- POST : Verify Multifactor OTP Authentication
- POST : Verify Multifactor Password Authentication
- POST : Verify Multifactor PIN Authentication
- GET : Multi Factor Re-Authenticate
Validate MFA by OTP (PUT)
This API is used to re-authenticate via Multi-factor authentication by passing the One Time Password received via SMSString accessToken = "<accessToken>"; //Required
ReauthByOtpModel reauthByOtpModel = new ReauthByOtpModel(); //Required
reauthByOtpModel.setOtp("otp");
ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi();
reAuthenticationApi.mfaReAuthenticateByOTP(accessToken, reauthByOtpModel , new AsyncHandler<EventBasedMultiFactorAuthenticationToken> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(EventBasedMultiFactorAuthenticationToken response) {
System.out.println(response.getExpireIn());
}
});
Validate MFA by Backup Code (PUT)
This API is used to re-authenticate by set of backup codes via access token on the site that has Multi-factor authentication enabled in re-authentication for the user that does not have the deviceString accessToken = "<accessToken>"; //Required
ReauthByBackupCodeModel reauthByBackupCodeModel = new ReauthByBackupCodeModel(); //Required
reauthByBackupCodeModel.setBackupCode("backupCode");
ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi();
reAuthenticationApi.mfaReAuthenticateByBackupCode(accessToken, reauthByBackupCodeModel , new AsyncHandler<EventBasedMultiFactorAuthenticationToken> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(EventBasedMultiFactorAuthenticationToken response) {
System.out.println(response.getExpireIn());
}
});
Validate MFA by Google Authenticator Code (PUT)
This API is used to re-authenticate via Multi-factor-authentication by passing the google authenticator codeString accessToken = "<accessToken>"; //Required
ReauthByGoogleAuthenticatorCodeModel reauthByGoogleAuthenticatorCodeModel = new ReauthByGoogleAuthenticatorCodeModel(); //Required
reauthByGoogleAuthenticatorCodeModel.setGoogleAuthenticatorCode("googleAuthenticatorCode");
ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi();
reAuthenticationApi.mfaReAuthenticateByGoogleAuth(accessToken, reauthByGoogleAuthenticatorCodeModel , new AsyncHandler<EventBasedMultiFactorAuthenticationToken> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(EventBasedMultiFactorAuthenticationToken response) {
System.out.println(response.getExpireIn());
}
});
Validate MFA by Password (PUT)
This API is used to re-authenticate via Multi-factor-authentication by passing the passwordString accessToken = "<accessToken>"; //Required
PasswordEventBasedAuthModelWithLockout passwordEventBasedAuthModelWithLockout = new PasswordEventBasedAuthModelWithLockout(); //Required
passwordEventBasedAuthModelWithLockout.setPassword("password");
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi();
reAuthenticationApi.mfaReAuthenticateByPassword(accessToken, passwordEventBasedAuthModelWithLockout, smsTemplate2FA , new AsyncHandler<EventBasedMultiFactorAuthenticationToken> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(EventBasedMultiFactorAuthenticationToken response) {
System.out.println(response.getExpireIn());
}
});
MFA Re-authentication by PIN (PUT)
This API is used to validate the triggered MFA authentication flow with a password.String accessToken = "<accessToken>"; //Required
PINAuthEventBasedAuthModelWithLockout pinAuthEventBasedAuthModelWithLockout = new PINAuthEventBasedAuthModelWithLockout(); //Required
pinAuthEventBasedAuthModelWithLockout.setPIN("pin");
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi();
reAuthenticationApi.verifyPINAuthentication(accessToken, pinAuthEventBasedAuthModelWithLockout, smsTemplate2FA , new AsyncHandler<EventBasedMultiFactorAuthenticationToken> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(EventBasedMultiFactorAuthenticationToken response) {
System.out.println(response.getExpireIn());
}
});
Verify Multifactor OTP Authentication (POST)
This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by OTP.EventBasedMultiFactorToken eventBasedMultiFactorToken = new EventBasedMultiFactorToken(); //Required
eventBasedMultiFactorToken.setSecondFactorValidationToken("secondFactorValidationToken");
String uid = "<uid>"; //Required
ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi();
reAuthenticationApi.verifyMultiFactorOtpReauthentication( eventBasedMultiFactorToken, uid , new AsyncHandler<PostValidationResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostValidationResponse response) {
System.out.println(response.getIsValid());
}
});
Verify Multifactor Password Authentication (POST)
This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by password.EventBasedMultiFactorToken eventBasedMultiFactorToken = new EventBasedMultiFactorToken(); //Required
eventBasedMultiFactorToken.setSecondFactorValidationToken("secondFactorValidationToken");
String uid = "<uid>"; //Required
ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi();
reAuthenticationApi.verifyMultiFactorPasswordReauthentication( eventBasedMultiFactorToken, uid , new AsyncHandler<PostValidationResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostValidationResponse response) {
System.out.println(response.getIsValid());
}
});
Verify Multifactor PIN Authentication (POST)
This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by PIN.EventBasedMultiFactorToken eventBasedMultiFactorToken = new EventBasedMultiFactorToken(); //Required
eventBasedMultiFactorToken.setSecondFactorValidationToken("secondFactorValidationToken");
String uid = "<uid>"; //Required
ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi();
reAuthenticationApi.verifyMultiFactorPINReauthentication( eventBasedMultiFactorToken, uid , new AsyncHandler<PostValidationResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostValidationResponse response) {
System.out.println(response.getIsValid());
}
});
Multi Factor Re-Authenticate (GET)
This API is used to trigger the Multi-Factor Autentication workflow for the provided access tokenString accessToken = "<accessToken>"; //Required
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi();
reAuthenticationApi.mfaReAuthenticate(accessToken, smsTemplate2FA , new AsyncHandler<MultiFactorAuthenticationSettingsResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(MultiFactorAuthenticationSettingsResponse response) {
System.out.println(response.getIsGoogleAuthenticatorVerified());
}
});
ConsentManagement API
List of APIs in this Section:
- PUT : Update Consent By Access Token
- POST : Consent By ConsentToken
- POST : Post Consent By Access Token
- GET : Get Consent Logs By Uid
- GET : Get Consent Log by Access Token
- GET : Get Verify Consent By Access Token
Update Consent By Access Token (PUT)
This API is to update consents using access token.String accessToken = "<accessToken>"; //Required
ConsentUpdateModel consentUpdateModel = new ConsentUpdateModel(); //Required
List<ConsentDataModel> consents = new ArrayList < ConsentDataModel >();
ConsentDataModel consentDataModel = new ConsentDataModel();
consentDataModel.setConsentOptionId("consentOptionId");
consentDataModel.setIsAccepted(true);
consents.add(consentDataModel);
consentUpdateModel.setConsents(consents);
ConsentManagementApi consentManagementApi = new ConsentManagementApi();
consentManagementApi.updateConsentProfileByAccessToken(accessToken, consentUpdateModel , new AsyncHandler<ConsentProfile> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ConsentProfile response) {
System.out.println(response.getAcceptedConsentVersions().get(0).getVersion());
}
});
Consent By ConsentToken (POST)
This API is to submit consent form using consent token.String consentToken = "<consentToken>"; //Required
ConsentSubmitModel consentSubmitModel = new ConsentSubmitModel(); //Required
List<ConsentDataModel> data = new ArrayList < ConsentDataModel >();
ConsentDataModel consentDataModel = new ConsentDataModel();
consentDataModel.setConsentOptionId("consentOptionId");
consentDataModel.setIsAccepted(true);
data.add(consentDataModel);
consentSubmitModel.setData(data);
List<ConsentEventModel> events = new ArrayList < ConsentEventModel >();
ConsentEventModel consentEventModel = new ConsentEventModel();
consentEventModel.setEvent("event");
consentEventModel.setIsCustom(true);
events.add(consentEventModel);
consentSubmitModel.setEvents(events);
ConsentManagementApi consentManagementApi = new ConsentManagementApi();
consentManagementApi.submitConsentByConsentToken(consentToken, consentSubmitModel , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
Post Consent By Access Token (POST)
API to provide a way to end user to submit a consent form for particular event type.String accessToken = "<accessToken>"; //Required
ConsentSubmitModel consentSubmitModel = new ConsentSubmitModel(); //Required
List<ConsentDataModel> data = new ArrayList < ConsentDataModel >();
ConsentDataModel consentDataModel = new ConsentDataModel();
consentDataModel.setConsentOptionId("consentOptionId");
consentDataModel.setIsAccepted(true);
data.add(consentDataModel);
consentSubmitModel.setData(data);
List<ConsentEventModel> events = new ArrayList < ConsentEventModel >();
ConsentEventModel consentEventModel = new ConsentEventModel();
consentEventModel.setEvent("event");
consentEventModel.setIsCustom(true);
events.add(consentEventModel);
consentSubmitModel.setEvents(events);
ConsentManagementApi consentManagementApi = new ConsentManagementApi();
consentManagementApi.submitConsentByAccessToken(accessToken, consentSubmitModel , new AsyncHandler<Identity> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
Get Consent Logs By Uid (GET)
This API is used to get the Consent logs of the user.String uid = "<uid>"; //Required
ConsentManagementApi consentManagementApi = new ConsentManagementApi();
consentManagementApi.getConsentLogsByUid(uid , new AsyncHandler<ConsentLogsResponseModel> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ConsentLogsResponseModel response) {
System.out.println(response.getConsentLogs().get(0).getId());
}
});
Get Consent Log by Access Token (GET)
This API is used to fetch consent logs.String accessToken = "<accessToken>"; //Required
ConsentManagementApi consentManagementApi = new ConsentManagementApi();
consentManagementApi.getConsentLogs(accessToken , new AsyncHandler<ConsentLogsResponseModel> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ConsentLogsResponseModel response) {
System.out.println(response.getConsentLogs().get(0).getId());
}
});
Get Verify Consent By Access Token (GET)
This API is used to check if consent is submitted for a particular event or not.String accessToken = "<accessToken>"; //Required
String event = "<event>"; //Required
Boolean isCustom = true; //Required
ConsentManagementApi consentManagementApi = new ConsentManagementApi();
consentManagementApi.verifyConsentByAccessToken(accessToken, event, isCustom , new AsyncHandler<ConsentProfileValidResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ConsentProfileValidResponse response) {
System.out.println(response.getConsentProfile().getConsents().get(0).getConsentOptionId());
}
});
SmartLogin API
List of APIs in this Section:
- GET : Smart Login Verify Token
- GET : Smart Login By Email
- GET : Smart Login By Username
- GET : Smart Login Ping
Smart Login Verify Token (GET)
This API verifies the provided token for Smart LoginString verificationToken = "<verificationToken>"; //Required
String welcomeEmailTemplate = "<welcomeEmailTemplate>"; //Optional
SmartLoginApi smartLoginApi = new SmartLoginApi();
smartLoginApi.smartLoginTokenVerification(verificationToken, welcomeEmailTemplate , new AsyncHandler<VerifiedResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(VerifiedResponse response) {
System.out.println(response.getIsPosted());
}
});
```S
<h4 id="SmartLoginByEmail-get-">Smart Login By Email (GET)</h4>
This API sends a Smart Login link to the user's Email Id.
```java
String clientGuid = "<clientGuid>"; //Required
String email = "<email>"; //Required
String redirectUrl = "<redirectUrl>"; //Optional
String smartLoginEmailTemplate = "<smartLoginEmailTemplate>"; //Optional
String welcomeEmailTemplate = "<welcomeEmailTemplate>"; //Optional
SmartLoginApi smartLoginApi = new SmartLoginApi();
smartLoginApi.smartLoginByEmail(clientGuid, email, redirectUrl, smartLoginEmailTemplate, welcomeEmailTemplate , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
Smart Login By Username (GET)
This API sends a Smart Login link to the user's Email Id.String clientGuid = "<clientGuid>"; //Required
String username = "<username>"; //Required
String redirectUrl = "<redirectUrl>"; //Optional
String smartLoginEmailTemplate = "<smartLoginEmailTemplate>"; //Optional
String welcomeEmailTemplate = "<welcomeEmailTemplate>"; //Optional
SmartLoginApi smartLoginApi = new SmartLoginApi();
smartLoginApi.smartLoginByUserName(clientGuid, username, redirectUrl, smartLoginEmailTemplate, welcomeEmailTemplate , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
Smart Login Ping (GET)
This API is used to check if the Smart Login link has been clicked or notString clientGuid = "<clientGuid>"; //Required
String fields = null; //Optional
SmartLoginApi smartLoginApi = new SmartLoginApi();
smartLoginApi.smartLoginPing(clientGuid, fields , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
OneTouchLogin API
List of APIs in this Section:
- PUT : One Touch OTP Verification
- POST : One Touch Login by Email
- POST : One Touch Login by Phone
- GET : One Touch Email Verification
- GET : One Touch Login Ping
One Touch OTP Verification (PUT)
This API is used to verify the otp for One Touch Login.String otp = "<otp>"; //Required
String phone = "<phone>"; //Required
String fields = null; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
OneTouchLoginApi oneTouchLoginApi = new OneTouchLoginApi();
oneTouchLoginApi.oneTouchLoginOTPVerification(otp, phone, fields, smsTemplate , new AsyncHandler<AccessToken<UserProfile>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<UserProfile> response) {
System.out.println(response.getAccess_Token());
}
});
One Touch Login by Email (POST)
This API is used to send a link to a specified email for a frictionless login/registrationOneTouchLoginByEmailModel oneTouchLoginByEmailModel = new OneTouchLoginByEmailModel(); //Required
oneTouchLoginByEmailModel.setClientguid("clientguid");
oneTouchLoginByEmailModel.setEmail("email");
oneTouchLoginByEmailModel.setG_Recaptcha_Response("g-recaptcha-response");
String oneTouchLoginEmailTemplate = "<oneTouchLoginEmailTemplate>"; //Optional
String redirecturl = "<redirecturl>"; //Optional
String welcomeemailtemplate = "<welcomeemailtemplate>"; //Optional
OneTouchLoginApi oneTouchLoginApi = new OneTouchLoginApi();
oneTouchLoginApi.oneTouchLoginByEmail( oneTouchLoginByEmailModel, oneTouchLoginEmailTemplate, redirecturl, welcomeemailtemplate , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
One Touch Login by Phone (POST)
This API is used to send one time password to a given phone number for a frictionless login/registration.OneTouchLoginByPhoneModel oneTouchLoginByPhoneModel = new OneTouchLoginByPhoneModel(); //Required
oneTouchLoginByPhoneModel.setG_Recaptcha_Response("g-recaptcha-response");
oneTouchLoginByPhoneModel.setPhone("phone");
String smsTemplate = "<smsTemplate>"; //Optional
OneTouchLoginApi oneTouchLoginApi = new OneTouchLoginApi();
oneTouchLoginApi.oneTouchLoginByPhone( oneTouchLoginByPhoneModel, smsTemplate , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
One Touch Email Verification (GET)
This API verifies the provided token for One Touch LoginString verificationToken = "<verificationToken>"; //Required
String welcomeEmailTemplate = "<welcomeEmailTemplate>"; //Optional
OneTouchLoginApi oneTouchLoginApi = new OneTouchLoginApi();
oneTouchLoginApi.oneTouchEmailVerification(verificationToken, welcomeEmailTemplate , new AsyncHandler<VerifiedResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(VerifiedResponse response) {
System.out.println(response.getIsPosted());
}
});
One Touch Login Ping (GET)
This API is used to check if the One Touch Login link has been clicked or not.String clientGuid = "<clientGuid>"; //Required
String fields = null; //Optional
OneTouchLoginApi oneTouchLoginApi = new OneTouchLoginApi();
oneTouchLoginApi.oneTouchLoginPing(clientGuid, fields , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
PasswordLessLogin API
List of APIs in this Section:
- PUT : Passwordless Login Phone Verification
- GET : Passwordless Login by Phone
- GET : Passwordless Login By Email
- GET : Passwordless Login By UserName
- GET : Passwordless Login Verification
Passwordless Login Phone Verification (PUT)
This API verifies an account by OTP and allows the customer to login.PasswordLessLoginOtpModel passwordLessLoginOtpModel = new PasswordLessLoginOtpModel(); //Required
passwordLessLoginOtpModel.setOtp("otp");
passwordLessLoginOtpModel.setPhone("phone");
String fields = null; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
PasswordLessLoginApi passwordLessLoginApi = new PasswordLessLoginApi();
passwordLessLoginApi.passwordlessLoginPhoneVerification( passwordLessLoginOtpModel, fields, smsTemplate , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
Passwordless Login by Phone (GET)
API can be used to send a One-time Passcode (OTP) provided that the account has a verified PhoneIDString phone = "<phone>"; //Required
String smsTemplate = "<smsTemplate>"; //Optional
PasswordLessLoginApi passwordLessLoginApi = new PasswordLessLoginApi();
passwordLessLoginApi.passwordlessLoginByPhone(phone, smsTemplate , new AsyncHandler<GetResponse<SMSResponseData>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(GetResponse<SMSResponseData> response) {
System.out.println(response.getData().getSid());
}
});
Passwordless Login By Email (GET)
This API is used to send a Passwordless Login verification link to the provided Email IDString email = "<email>"; //Required
String passwordLessLoginTemplate = "<passwordLessLoginTemplate>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
PasswordLessLoginApi passwordLessLoginApi = new PasswordLessLoginApi();
passwordLessLoginApi.passwordlessLoginByEmail(email, passwordLessLoginTemplate, verificationUrl , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
Passwordless Login By UserName (GET)
This API is used to send a Passwordless Login Verification Link to a customer by providing their UserNameString username = "<username>"; //Required
String passwordLessLoginTemplate = "<passwordLessLoginTemplate>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
PasswordLessLoginApi passwordLessLoginApi = new PasswordLessLoginApi();
passwordLessLoginApi.passwordlessLoginByUserName(username, passwordLessLoginTemplate, verificationUrl , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
Passwordless Login Verification (GET)
This API is used to verify the Passwordless Login verification link. Note: If you are using Passwordless Login by Phone you will need to use the Passwordless Login Phone Verification APIString verificationToken = "<verificationToken>"; //Required
String fields = null; //Optional
String welcomeEmailTemplate = "<welcomeEmailTemplate>"; //Optional
PasswordLessLoginApi passwordLessLoginApi = new PasswordLessLoginApi();
passwordLessLoginApi.passwordlessLoginVerification(verificationToken, fields, welcomeEmailTemplate , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
Configuration API
List of APIs in this Section:
- GET : Get Server Time
- GET : Get Configurations
Get Server Time (GET)
This API allows you to query your LoginRadius account for basic server information and server time information which is useful when generating an SOTT token.Integer timeDifference = 0; //Optional
ConfigurationApi configurationApi = new ConfigurationApi();
configurationApi.getServerInfo(timeDifference , new AsyncHandler<ServiceInfoModel> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ServiceInfoModel response) {
System.out.println(response.getCurrentTime());
}
});
Get Configuration (GET)
This API is used to get the configurations which are set in the LoginRadius Admin Console for a particular LoginRadius site/environment.ConfigurationApi configurationApi = new ConfigurationApi();
configurationApi.getConfigurations(new AsyncHandler<ConfigResponseModel>() {
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ConfigResponseModel response) {
System.out.println(response.getAppName());
}
});
Role API
List of APIs in this Section:
- PUT : Assign Roles by UID
- PUT : Upsert Context
- PUT : Add Permissions to Role
- POST : Roles Create
- GET : Roles by UID
- GET : Get Context with Roles and Permissions
- GET : Role Context profile
- GET : Roles List
- DELETE : Unassign Roles by UID
- DELETE : Delete Role Context
- DELETE : Delete Role from Context
- DELETE : Delete Additional Permission from Context
- DELETE : Account Delete Role
- DELETE : Remove Permissions
Assign Roles by UID (PUT)
This API is used to assign your desired roles to a given user.AccountRolesModel accountRolesModel = new AccountRolesModel(); //Required
List<String> roles = new ArrayList < String >();
roles.add("roles");
accountRolesModel.setRoles(roles);
String uid = "<uid>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.assignRolesByUid( accountRolesModel, uid , new AsyncHandler<com.loginradius.sdk.models.responsemodels.otherobjects.AccountRolesModel> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(com.loginradius.sdk.models.responsemodels.otherobjects.AccountRolesModel response) {
System.out.println(response.getRoles());
}
});
Upsert Context (PUT)
This API creates a Context with a set of RolesAccountRoleContextModel accountRoleContextModel = new AccountRoleContextModel(); //Required
List<RoleContextRoleModel> roleContext = new ArrayList < RoleContextRoleModel >();
RoleContextRoleModel roleContextRoleModel = new RoleContextRoleModel();
List<String> additionalPermissions = new ArrayList < String > ();
additionalPermissions.add("additionalPermissions");
roleContextRoleModel.setAdditionalPermissions(additionalPermissions);
roleContextRoleModel.setContext("context");
roleContextRoleModel.setExpiration("expiration");
List<String> roles = new ArrayList < String > ();
roles.add("roles");
roleContextRoleModel.setRoles(roles);
roleContext.add(roleContextRoleModel);
accountRoleContextModel.setRoleContext(roleContext);
String uid = "<uid>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.updateRoleContextByUid( accountRoleContextModel, uid , new AsyncHandler<ListReturn<RoleContext>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ListReturn<RoleContext> response) {
System.out.println(response.getData().get(0).getAdditionalPermissions());
}
});
Add Permissions to Role (PUT)
This API is used to add permissions to a given role.PermissionsModel permissionsModel = new PermissionsModel(); //Required
List<String> permissions = new ArrayList < String >();
permissions.add("permissions");
permissionsModel.setPermissions(permissions);
String role = "<role>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.addRolePermissions( permissionsModel, role , new AsyncHandler<com.loginradius.sdk.models.responsemodels.otherobjects.RoleModel> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(com.loginradius.sdk.models.responsemodels.otherobjects.RoleModel response) {
System.out.println(response.getName());
}
});
Roles Create (POST)
This API creates a role with permissions.RolesModel rolesModel = new RolesModel(); //Required
List<com.loginradius.sdk.models.requestmodels.RoleModel> roles = new ArrayList < com.loginradius.sdk.models.requestmodels.RoleModel >();
RoleModel roleModel = new RoleModel();
roleModel.setName("name");
Map<String,Boolean> permissions= new HashMap<String,Boolean> ();
permissions.put( "Permission Name", true );
roleModel.setPermissions(permissions);
roles.add(roleModel);
rolesModel.setRoles(roles);
RoleApi roleApi = new RoleApi();
roleApi.createRoles( rolesModel , new AsyncHandler<ListData<com.loginradius.sdk.models.responsemodels.otherobjects.RoleModel>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ListData<com.loginradius.sdk.models.responsemodels.otherobjects.RoleModel> response) {
System.out.println(response.getCount());
}
});
Roles by UID (GET)
API is used to retrieve all the assigned roles of a particular User.String uid = "<uid>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.getRolesByUid(uid , new AsyncHandler<com.loginradius.sdk.models.responsemodels.otherobjects.AccountRolesModel> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(com.loginradius.sdk.models.responsemodels.otherobjects.AccountRolesModel response) {
System.out.println(response.getRoles());
}
});
Get Context with Roles and Permissions (GET)
This API Gets the contexts that have been configured and the associated roles and permissions.String uid = "<uid>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.getRoleContextByUid(uid , new AsyncHandler<ListReturn<RoleContext>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ListReturn<RoleContext> response) {
System.out.println(response.getData().get(0).getAdditionalPermissions());
}
});
Role Context profile (GET)
The API is used to retrieve role context by the context name.String contextName = "<contextName>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.getRoleContextByContextName(contextName , new AsyncHandler<ListReturn<RoleContextResponseModel>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ListReturn<RoleContextResponseModel> response) {
System.out.println(response.getData().get(0).getEmail().get(0).getValue());
}
});
Roles List (GET)
This API retrieves the complete list of created roles with permissions of your app.RoleApi roleApi = new RoleApi();
roleApi.getRolesList( new AsyncHandler<ListData<com.loginradius.sdk.models.responsemodels.otherobjects.RoleModel>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ListData<com.loginradius.sdk.models.responsemodels.otherobjects.RoleModel> response) {
System.out.println(response.getCount());
}
});
Unassign Roles by UID (DELETE)
This API is used to unassign roles from a user.AccountRolesModel accountRolesModel = new AccountRolesModel(); //Required
List<String> roles = new ArrayList < String >();
roles.add("roles");
accountRolesModel.setRoles(roles);
String uid = "<uid>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.unassignRolesByUid( accountRolesModel, uid , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
Delete Role Context (DELETE)
This API Deletes the specified Role ContextString contextName = "<contextName>"; //Required
String uid = "<uid>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.deleteRoleContextByUid(contextName, uid , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
Delete Role from Context (DELETE)
This API Deletes the specified Role from a Context.String contextName = "<contextName>"; //Required
RoleContextRemoveRoleModel roleContextRemoveRoleModel = new RoleContextRemoveRoleModel(); //Required
List<String> roles = new ArrayList < String >();
roles.add("roles");
roleContextRemoveRoleModel.setRoles(roles);
String uid = "<uid>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.deleteRolesFromRoleContextByUid(contextName, roleContextRemoveRoleModel, uid , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
Delete Additional Permission from Context (DELETE)
This API Deletes Additional Permissions from Context.String contextName = "<contextName>"; //Required
RoleContextAdditionalPermissionRemoveRoleModel roleContextAdditionalPermissionRemoveRoleModel = new RoleContextAdditionalPermissionRemoveRoleModel(); //Required
List<String> additionalPermissions = new ArrayList < String >();
additionalPermissions.add("additionalPermissions");
roleContextAdditionalPermissionRemoveRoleModel.setAdditionalPermissions(additionalPermissions);
String uid = "<uid>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.deleteAdditionalPermissionFromRoleContextByUid(contextName, roleContextAdditionalPermissionRemoveRoleModel, uid , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
Account Delete Role (DELETE)
This API is used to delete the role.String role = "<role>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.deleteRole(role , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
Remove Permissions (DELETE)
API is used to remove permissions from a role.PermissionsModel permissionsModel = new PermissionsModel(); //Required
List<String> permissions = new ArrayList < String >();
permissions.add("permissions");
permissionsModel.setPermissions(permissions);
String role = "<role>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.removeRolePermissions( permissionsModel, role , new AsyncHandler<com.loginradius.sdk.models.responsemodels.otherobjects.RoleModel> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(com.loginradius.sdk.models.responsemodels.otherobjects.RoleModel response) {
System.out.println(response.getName());
}
});
CustomRegistrationData API
List of APIs in this Section:
- PUT : Update Registration Data
- POST : Validate secret code
- POST : Add Registration Data
- GET : Auth Get Registration Data Server
- GET : Get Registration Data
- DELETE : Delete Registration Data
- DELETE : Delete All Records by Datasource
Update Registration Data (PUT)
This API allows you to update a dropdown itemRegistrationDataUpdateModel registrationDataUpdateModel = new RegistrationDataUpdateModel(); //Required
registrationDataUpdateModel.setIsActive(true);
registrationDataUpdateModel.setKey("key");
registrationDataUpdateModel.setType("type");
registrationDataUpdateModel.setValue("value");
String recordId = "<recordId>"; //Required
CustomRegistrationDataApi customRegistrationDataApi = new CustomRegistrationDataApi();
customRegistrationDataApi.updateRegistrationData( registrationDataUpdateModel, recordId , new AsyncHandler<UserProfilePostResponse<RegistrationDataField>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<RegistrationDataField> response) {
System.out.println(response.getIsPosted());
}
});
Validate secret code (POST)
This API allows you to validate code for a particular dropdown member.String code = "<code>"; //Required
String recordId = "<recordId>"; //Required
CustomRegistrationDataApi customRegistrationDataApi = new CustomRegistrationDataApi();
customRegistrationDataApi.validateRegistrationDataCode(code, recordId , new AsyncHandler<PostValidationResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostValidationResponse response) {
System.out.println(response.getIsValid());
}
});
Add Registration Data (POST)
This API allows you to fill data into a dropdown list which you have created for user Registration. For more details on how to use this API please see our Custom Registration Data OverviewRegistrationDataCreateModelList registrationDataCreateModelList = new RegistrationDataCreateModelList(); //Required
List<RegistrationDataCreateModel> data = new ArrayList < RegistrationDataCreateModel >();
RegistrationDataCreateModel registrationDataCreateModel = new RegistrationDataCreateModel();
registrationDataCreateModel.setCode("code");
registrationDataCreateModel.setIsActive(true);
registrationDataCreateModel.setKey("key");
registrationDataCreateModel.setParentId("parentId");
registrationDataCreateModel.setType("type");
registrationDataCreateModel.setValue("value");
data.add(registrationDataCreateModel);
registrationDataCreateModelList.setData(data);
CustomRegistrationDataApi customRegistrationDataApi = new CustomRegistrationDataApi();
customRegistrationDataApi.addRegistrationData( registrationDataCreateModelList , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
Auth Get Registration Data Server (GET)
This API is used to retrieve dropdown data.String type = "<type>"; //Required
Integer limit = 0; //Optional
String parentId = "<parentId>"; //Optional
Integer skip = 0; //Optional
CustomRegistrationDataApi customRegistrationDataApi = new CustomRegistrationDataApi();
customRegistrationDataApi.authGetRegistrationData(type, limit, parentId, skip , new AsyncHandler<RegistrationDataField[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(RegistrationDataField[] response) {
System.out.println(response[0].getCode());
}
});
Get Registration Data (GET)
This API is used to retrieve dropdown data.String type = "<type>"; //Required
Integer limit = 0; //Optional
String parentId = "<parentId>"; //Optional
Integer skip = 0; //Optional
CustomRegistrationDataApi customRegistrationDataApi = new CustomRegistrationDataApi();
customRegistrationDataApi.getRegistrationData(type, limit, parentId, skip , new AsyncHandler<RegistrationDataField[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(RegistrationDataField[] response) {
System.out.println(response[0].getCode());
}
});
Delete Registration Data (DELETE)
This API allows you to delete an item from a dropdown list.String recordId = "<recordId>"; //Required
CustomRegistrationDataApi customRegistrationDataApi = new CustomRegistrationDataApi();
customRegistrationDataApi.deleteRegistrationData(recordId , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
Delete All Records by Datasource (DELETE)
This API allows you to delete all records contained in a datasource.String type = "<type>"; //Required
CustomRegistrationDataApi customRegistrationDataApi = new CustomRegistrationDataApi();
customRegistrationDataApi.deleteAllRecordsByDataSource(type , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
RiskBasedAuthentication API
List of APIs in this Section:
- POST : Risk Based Authentication Login by Email
- POST : Risk Based Authentication Login by Username
- POST : Risk Based Authentication Phone Login
Risk Based Authentication Login by Email (POST)
This API retrieves a copy of the user data based on the EmailEmailAuthenticationModel emailAuthenticationModel = new EmailAuthenticationModel(); //Required
emailAuthenticationModel.setEmail("email");
emailAuthenticationModel.setPassword("password");
String emailTemplate = "<emailTemplate>"; //Optional
String fields = null; //Optional
String loginUrl = "<loginUrl>"; //Optional
Boolean passwordDelegation = true; //Optional
String passwordDelegationApp = "<passwordDelegationApp>"; //Optional
String rbaBrowserEmailTemplate = "<rbaBrowserEmailTemplate>"; //Optional
String rbaBrowserSmsTemplate = "<rbaBrowserSmsTemplate>"; //Optional
String rbaCityEmailTemplate = "<rbaCityEmailTemplate>"; //Optional
String rbaCitySmsTemplate = "<rbaCitySmsTemplate>"; //Optional
String rbaCountryEmailTemplate = "<rbaCountryEmailTemplate>"; //Optional
String rbaCountrySmsTemplate = "<rbaCountrySmsTemplate>"; //Optional
String rbaIpEmailTemplate = "<rbaIpEmailTemplate>"; //Optional
String rbaIpSmsTemplate = "<rbaIpSmsTemplate>"; //Optional
String rbaOneclickEmailTemplate = "<rbaOneclickEmailTemplate>"; //Optional
String rbaOTPSmsTemplate = "<rbaOTPSmsTemplate>"; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
RiskBasedAuthenticationApi riskBasedAuthenticationApi = new RiskBasedAuthenticationApi();
riskBasedAuthenticationApi.rbaLoginByEmail( emailAuthenticationModel, emailTemplate, fields, loginUrl, passwordDelegation, passwordDelegationApp, rbaBrowserEmailTemplate, rbaBrowserSmsTemplate, rbaCityEmailTemplate, rbaCitySmsTemplate, rbaCountryEmailTemplate, rbaCountrySmsTemplate, rbaIpEmailTemplate, rbaIpSmsTemplate, rbaOneclickEmailTemplate, rbaOTPSmsTemplate, smsTemplate, verificationUrl , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
Risk Based Authentication Login by Username (POST)
This API retrieves a copy of the user data based on the UsernameUserNameAuthenticationModel userNameAuthenticationModel = new UserNameAuthenticationModel(); //Required
userNameAuthenticationModel.setPassword("password");
userNameAuthenticationModel.setUsername("username");
String emailTemplate = "<emailTemplate>"; //Optional
String fields = null; //Optional
String loginUrl = "<loginUrl>"; //Optional
Boolean passwordDelegation = true; //Optional
String passwordDelegationApp = "<passwordDelegationApp>"; //Optional
String rbaBrowserEmailTemplate = "<rbaBrowserEmailTemplate>"; //Optional
String rbaBrowserSmsTemplate = "<rbaBrowserSmsTemplate>"; //Optional
String rbaCityEmailTemplate = "<rbaCityEmailTemplate>"; //Optional
String rbaCitySmsTemplate = "<rbaCitySmsTemplate>"; //Optional
String rbaCountryEmailTemplate = "<rbaCountryEmailTemplate>"; //Optional
String rbaCountrySmsTemplate = "<rbaCountrySmsTemplate>"; //Optional
String rbaIpEmailTemplate = "<rbaIpEmailTemplate>"; //Optional
String rbaIpSmsTemplate = "<rbaIpSmsTemplate>"; //Optional
String rbaOneclickEmailTemplate = "<rbaOneclickEmailTemplate>"; //Optional
String rbaOTPSmsTemplate = "<rbaOTPSmsTemplate>"; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
RiskBasedAuthenticationApi riskBasedAuthenticationApi = new RiskBasedAuthenticationApi();
riskBasedAuthenticationApi.rbaLoginByUserName( userNameAuthenticationModel, emailTemplate, fields, loginUrl, passwordDelegation, passwordDelegationApp, rbaBrowserEmailTemplate, rbaBrowserSmsTemplate, rbaCityEmailTemplate, rbaCitySmsTemplate, rbaCountryEmailTemplate, rbaCountrySmsTemplate, rbaIpEmailTemplate, rbaIpSmsTemplate, rbaOneclickEmailTemplate, rbaOTPSmsTemplate, smsTemplate, verificationUrl , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
Risk Based Authentication Phone Login (POST)
This API retrieves a copy of the user data based on the PhonePhoneAuthenticationModel phoneAuthenticationModel = new PhoneAuthenticationModel(); //Required
phoneAuthenticationModel.setPassword("password");
phoneAuthenticationModel.setPhone("phone");
String emailTemplate = "<emailTemplate>"; //Optional
String fields = null; //Optional
String loginUrl = "<loginUrl>"; //Optional
Boolean passwordDelegation = true; //Optional
String passwordDelegationApp = "<passwordDelegationApp>"; //Optional
String rbaBrowserEmailTemplate = "<rbaBrowserEmailTemplate>"; //Optional
String rbaBrowserSmsTemplate = "<rbaBrowserSmsTemplate>"; //Optional
String rbaCityEmailTemplate = "<rbaCityEmailTemplate>"; //Optional
String rbaCitySmsTemplate = "<rbaCitySmsTemplate>"; //Optional
String rbaCountryEmailTemplate = "<rbaCountryEmailTemplate>"; //Optional
String rbaCountrySmsTemplate = "<rbaCountrySmsTemplate>"; //Optional
String rbaIpEmailTemplate = "<rbaIpEmailTemplate>"; //Optional
String rbaIpSmsTemplate = "<rbaIpSmsTemplate>"; //Optional
String rbaOneclickEmailTemplate = "<rbaOneclickEmailTemplate>"; //Optional
String rbaOTPSmsTemplate = "<rbaOTPSmsTemplate>"; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
RiskBasedAuthenticationApi riskBasedAuthenticationApi = new RiskBasedAuthenticationApi();
riskBasedAuthenticationApi.rbaLoginByPhone( phoneAuthenticationModel, emailTemplate, fields, loginUrl, passwordDelegation, passwordDelegationApp, rbaBrowserEmailTemplate, rbaBrowserSmsTemplate, rbaCityEmailTemplate, rbaCitySmsTemplate, rbaCountryEmailTemplate, rbaCountrySmsTemplate, rbaIpEmailTemplate, rbaIpSmsTemplate, rbaOneclickEmailTemplate, rbaOTPSmsTemplate, smsTemplate, verificationUrl , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
Sott API
List of APIs in this Section:
- GET : Generate SOTT
Generate SOTT (GET)
This API allows you to generate SOTT with a given expiration time.Integer timeDifference = 0; //Optional
SottApi sottApi = new SottApi();
sottApi.generateSott(timeDifference , new AsyncHandler<SottResponseData> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(SottResponseData response) {
System.out.println(response.getExpiryTime());
}
});
NativeSocial API
List of APIs in this Section:
- GET : Access Token via Facebook Token
- GET : Access Token via Twitter Token
- GET : Access Token via Google Token
- GET : Access Token using google JWT token for Native Mobile Login
- GET : Access Token via Linkedin Token
- GET : Get Access Token By Foursquare Access Token
- GET : Access Token via Apple Id Code
- GET : Access Token via WeChat Code
- GET : Access Token via Vkontakte Token
- GET : Access Token via Google AuthCode
Access Token via Facebook Token (GET)
The API is used to get LoginRadius access token by sending Facebook's access token. It will be valid for the specific duration of time specified in the response.String fbAccessToken = "<fbAccessToken>"; //Required
String socialAppName = "<socialAppName>"; //Optional
NativeSocialApi nativeSocialApi = new NativeSocialApi();
nativeSocialApi.getAccessTokenByFacebookAccessToken(fbAccessToken, socialAppName , new AsyncHandler<AccessTokenBase> (){
@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 via Twitter Token (GET)
The API is used to get LoginRadius access token by sending Twitter's access token. It will be valid for the specific duration of time specified in the response.String twAccessToken = "<twAccessToken>"; //Required
String twTokenSecret = "<twTokenSecret>"; //Required
String socialAppName = "<socialAppName>"; //Optional
NativeSocialApi nativeSocialApi = new NativeSocialApi();
nativeSocialApi.getAccessTokenByTwitterAccessToken(twAccessToken, twTokenSecret, socialAppName , new AsyncHandler<AccessTokenBase> (){
@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 via Google Token (GET)
The API is used to get LoginRadius access token by sending Google's access token. It will be valid for the specific duration of time specified in the response.String googleAccessToken = "<googleAccessToken>"; //Required
String clientId = "<clientId>"; //Optional
String refreshToken = "<refreshToken>"; //Optional
String socialAppName = "<socialAppName>"; //Optional
NativeSocialApi nativeSocialApi = new NativeSocialApi();
nativeSocialApi.getAccessTokenByGoogleAccessToken(googleAccessToken, clientId, refreshToken, socialAppName , new AsyncHandler<AccessTokenBase> (){
@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 using google JWT token for Native Mobile Login (GET)
This API is used to Get LoginRadius Access Token using google jwt id token for google native mobile login/registration.String idToken = "<idToken>"; //Required
NativeSocialApi nativeSocialApi = new NativeSocialApi();
nativeSocialApi.getAccessTokenByGoogleJWTAccessToken(idToken , new AsyncHandler<AccessTokenBase> (){
@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 via Linkedin Token (GET)
The API is used to get LoginRadius access token by sending Linkedin's access token. It will be valid for the specific duration of time specified in the response.String lnAccessToken = "<lnAccessToken>"; //Required
String socialAppName = "<socialAppName>"; //Optional
NativeSocialApi nativeSocialApi = new NativeSocialApi();
nativeSocialApi.getAccessTokenByLinkedinAccessToken(lnAccessToken, socialAppName , new AsyncHandler<AccessTokenBase> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_Token());
}
});
Get Access Token By Foursquare Access Token (GET)
The API is used to get LoginRadius access token by sending Foursquare's access token. It will be valid for the specific duration of time specified in the response.String fsAccessToken = "<fsAccessToken>"; //Required
NativeSocialApi nativeSocialApi = new NativeSocialApi();
nativeSocialApi.getAccessTokenByFoursquareAccessToken(fsAccessToken , new AsyncHandler<AccessTokenBase> (){
@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 via Apple Id Code (GET)
The API is used to get LoginRadius access token by sending a valid Apple ID OAuth Code. It will be valid for the specific duration of time specified in the response.String code = "<code>"; //Required
String socialAppName = "<socialAppName>"; //Optional
NativeSocialApi nativeSocialApi = new NativeSocialApi();
nativeSocialApi.getAccessTokenByAppleIdCode(code, socialAppName , new AsyncHandler<AccessTokenBase> (){
@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 via WeChat Code (GET)
This API is used to retrieve a LoginRadius access token by passing in a valid WeChat OAuth Code.String code = "<code>"; //Required
NativeSocialApi nativeSocialApi = new NativeSocialApi();
nativeSocialApi.getAccessTokenByWeChatCode(code , new AsyncHandler<AccessTokenBase> (){
@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 via Vkontakte Token (GET)
The API is used to get LoginRadius access token by sending Vkontakte's access token. It will be valid for the specific duration of time specified in the response.String vkAccessToken = "<vkAccessToken>"; //Required
NativeSocialApi nativeSocialApi = new NativeSocialApi();
nativeSocialApi.getAccessTokenByVkontakteAccessToken(vkAccessToken , new AsyncHandler<AccessTokenBase> (){
@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 via Google AuthCode (GET)
The API is used to get LoginRadius access token by sending Google's AuthCode. It will be valid for the specific duration of time specified in the response.String googleAuthcode = "<googleAuthcode>"; //Required
String socialAppName = "<socialAppName>"; //Optional
NativeSocialApi nativeSocialApi = new NativeSocialApi();
nativeSocialApi.getAccessTokenByGoogleAuthCode(googleAuthcode, socialAppName , new AsyncHandler<AccessTokenBase> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_Token());
}
});
WebHook API
List of APIs in this Section:
- POST : Webhook Subscribe
- GET : Webhook Subscribed URLs
- GET : Webhook Test
- DELETE : WebHook Unsubscribe
Webhook Subscribe (POST)
API can be used to configure a WebHook on your LoginRadius site. Webhooks also work on subscribe and notification model, subscribe your hook and get a notification. Equivalent to RESThook but these provide security on basis of signature and RESThook work on unique URL. Following are the events that are allowed by LoginRadius to trigger a WebHook service call.WebHookSubscribeModel webHookSubscribeModel = new WebHookSubscribeModel(); //Required
webHookSubscribeModel.setEvent("event");
webHookSubscribeModel.setTargetUrl("targetUrl");
WebHookApi webHookApi = new WebHookApi();
webHookApi.webHookSubscribe( webHookSubscribeModel , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
Webhook Subscribed URLs (GET)
This API is used to fatch all the subscribed URLs, for particular eventString event = "<event>"; //Required
WebHookApi webHookApi = new WebHookApi();
webHookApi.getWebHookSubscribedURLs(event , new AsyncHandler<ListData<com.loginradius.sdk.models.responsemodels.otherobjects.WebHookSubscribeModel>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ListData<com.loginradius.sdk.models.responsemodels.otherobjects.WebHookSubscribeModel> response) {
System.out.println(response.getCount());
}
});
Webhook Test (GET)
API can be used to test a subscribed WebHook.WebHookApi webHookApi = new WebHookApi();
webHookApi.webhookTest( new AsyncHandler<EntityPermissionAcknowledgement> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(EntityPermissionAcknowledgement response) {
System.out.println(response.getIsAllowed());
}
});
WebHook Unsubscribe (DELETE)
API can be used to unsubscribe a WebHook configured on your LoginRadius site.WebHookSubscribeModel webHookSubscribeModel = new WebHookSubscribeModel(); //Required
webHookSubscribeModel.setEvent("event");
webHookSubscribeModel.setTargetUrl("targetUrl");
WebHookApi webHookApi = new WebHookApi();
webHookApi.webHookUnsubscribe( webHookSubscribeModel , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.