Giter VIP home page Giter VIP logo

python-sdk's Introduction

Python-SDK

Customer Identity public repo for Python SDK, based on LoginRadius V2 APIs.

Home Image

Introduction

LoginRadius Python SDK Customer Registration wrapper provides access to LoginRadius Identity Management Platform API.

This SDK provides a wrapper for urllib2 or the requests library to easily access the API from https://www.loginradius.com/docs/ in a more "pythonic" way. Providing easier access to essential data in a few lines of code. This will work with 2.0 API specifications.

LoginRadius is an Identity Management Platform that simplifies user registration while securing data. LoginRadius Platform simplifies and secures your user registration process, increases conversion with Social Login that combines 30 major social platforms, and offers a full solution with Traditional User Registration. You can gather a wealth of user profile data from Social Login or Traditional User Registration.

Documentation


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.

Prerequisites

You will need at least Python - 2.7 or greater. LoginRadius module utilizes the namedtuple from the collections library and the import_module from importlib.

Install From Package

Using pip

 pip install loginradius-v2==11.2.0

or with easy_install

 easy_install loginradius-v2==11.2.0

Install From Source

You can download the latest version from PyPI

  • Unzip/untar the files.
  • Browse to the directory that you extracted the files to.
  • Run python setup.py install to install the LoginRadius module.

Initialize SDK

Import the class

 from LoginRadius import LoginRadius as LR

When you initialize your application, you will need to set your API Key and Secret. This can be found in your here.

When your Python application initializes, set your API Key and Secret

 LR.API_KEY = "<API-KEY>"
 LR.API_SECRET = "<API-SECRET>"
 loginradius = LR()

Custom Domain

When initializing the SDK, optionally specify a custom domain.

LR.CUSTOM_DOMAIN = "<CUSTOM-DOMAIN>"

API Request Signing

To enable API request signing, set the value of 'API_REQUEST_SIGNING' to True

LR.API_REQUEST_SIGNING = True

X-Origin-IP

LoginRadius allows you to add X-Origin-IP in your headers and it determines the IP address of the client's request,this can also be useful to overcome analytics discrepancies where the analytics depend on header data.

LR.ORIGIN_IP = "<Client-Ip-Address>"

Authentication API

List of APIs in this Section:

Auth Update Profile by Token (PUT)
This API is used to update the user's profile by passing the access token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-update-profile-by-token/)
 
access_token = "<access_token>" #Required
user_profile_update_model = { 
"firstName" : "<firstName>",
"lastName" : "<lastName>"
}  #Required 
email_template = "<email_template>" #Optional 
fields = "<fields>" #Optional 
null_support = "True" #Optional 
sms_template = "<sms_template>" #Optional 
verification_url = "<verification_url>" #Optional

result = loginradius.authentication.update_profile_by_access_token(access_token, user_profile_update_model, email_template, fields, null_support, sms_template, verification_url)
Auth Unlock Account by Access Token (PUT)
This API is used to allow a customer with a valid access token to unlock their account provided that they successfully pass the prompted Bot Protection challenges. The Block or Suspend block types are not applicable for this API. For additional details see our Auth Security Configuration documentation.You are only required to pass the Post Parameters that correspond to the prompted challenges. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-unlock-account-by-access-token/)
 
access_token = "<access_token>" #Required
unlock_profile_model = { 
"g-recaptcha-response" : "<g-recaptcha-response>"
}  #Required

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

email_verification_by_otp_model = { 
"email" : "<email>",
"otp" : "<otp>"
}  #Required 
fields = "<fields>" #Optional 
url = "<url>" #Optional 
welcome_email_template = "<welcome_email_template>" #Optional

result = loginradius.authentication.verify_email_by_otp(email_verification_by_otp_model, fields, url, welcome_email_template)
Auth Reset Password by Security Answer and Email (PUT)
This API is used to reset password for the specified account by security question [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-email)

reset_password_by_security_answer_and_email_model = { 
"email" : "<email>",
"password" : "<password>",
"securityAnswer" : {"QuestionID":"Answer"}
}  #Required

result = loginradius.authentication.reset_password_by_security_answer_and_email(reset_password_by_security_answer_and_email_model)
Auth Reset Password by Security Answer and Phone (PUT)
This API is used to reset password for the specified account by security question [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-phone)

reset_password_by_security_answer_and_phone_model = { 
"password" : "<password>",
"phone" : "<phone>",
"securityAnswer" : {"QuestionID":"Answer"}
}  #Required

result = loginradius.authentication.reset_password_by_security_answer_and_phone(reset_password_by_security_answer_and_phone_model)
Auth Reset Password by Security Answer and UserName (PUT)
This API is used to reset password for the specified account by security question [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-username)

reset_password_by_security_answer_and_user_name_model = { 
"password" : "<password>",
"securityAnswer" : {"QuestionID":"Answer"},
"userName" : "<userName>"
}  #Required

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

reset_password_by_reset_token_model = { 
"password" : "<password>",
"resetToken" : "<resetToken>"
}  #Required

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

reset_password_by_email_and_otp_model = { 
"email" : "<email>",
"otp" : "<otp>",
"password" : "<password>"
}  #Required

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

reset_password_by_user_name_model = { 
"otp" : "<otp>",
"password" : "<password>",
"userName" : "<userName>"
}  #Required

result = loginradius.authentication.reset_password_by_otp_and_user_name(reset_password_by_user_name_model)
Auth Change Password (PUT)
This API is used to change the accounts password based on the previous password [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-change-password)
 
access_token = "<access_token>" #Required 
new_password = "<new_password>" #Required 
old_password = "<old_password>" #Required

result = loginradius.authentication.change_password(access_token, new_password, old_password)
Auth Set or Change UserName (PUT)
This API is used to set or change UserName by access token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-set-or-change-user-name/)
 
access_token = "<access_token>" #Required 
username = "<username>" #Required

result = loginradius.authentication.set_or_change_user_name(access_token, username)
Auth Resend Email Verification (PUT)
This API resends the verification email to the user. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-resend-email-verification/)
 
email = "<email>" #Required 
email_template = "<email_template>" #Optional 
verification_url = "<verification_url>" #Optional

result = loginradius.authentication.auth_resend_email_verification(email, email_template, verification_url)
Auth Add Email (POST)
This API is used to add additional emails to a user's account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-add-email)
 
access_token = "<access_token>" #Required 
email = "<email>" #Required 
type = "<type>" #Required 
email_template = "<email_template>" #Optional 
verification_url = "<verification_url>" #Optional

result = loginradius.authentication.add_email(access_token, email, type, email_template, verification_url)
Auth Login by Email (POST)
This API retrieves a copy of the user data based on the Email [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-login-by-email)

email_authentication_model = { 
"email" : "<email>",
"password" : "<password>"
}  #Required 
email_template = "<email_template>" #Optional 
fields = "<fields>" #Optional 
login_url = "<login_url>" #Optional 
verification_url = "<verification_url>" #Optional

result = loginradius.authentication.login_by_email(email_authentication_model, email_template, fields, login_url, verification_url)
Auth Login by Username (POST)
This API retrieves a copy of the user data based on the Username [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-login-by-username)

user_name_authentication_model = { 
"password" : "<password>",
"username" : "<username>"
}  #Required 
email_template = "<email_template>" #Optional 
fields = "<fields>" #Optional 
login_url = "<login_url>" #Optional 
verification_url = "<verification_url>" #Optional

result = loginradius.authentication.login_by_user_name(user_name_authentication_model, email_template, fields, login_url, verification_url)
Auth Forgot Password (POST)
This API is used to send the reset password url to a specified account. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username' [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-forgot-password)
 
email = "<email>" #Required 
reset_password_url = "<reset_password_url>" #Required 
email_template = "<email_template>" #Optional

result = loginradius.authentication.forgot_password(email, reset_password_url, email_template)
Auth Link Social Identities (POST)
This API is used to link up a social provider account with an existing LoginRadius account on the basis of access token and the social providers user access token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-link-social-identities)
 
access_token = "<access_token>" #Required 
candidate_token = "<candidate_token>" #Required

result = loginradius.authentication.link_social_identities(access_token, candidate_token)
Auth Link Social Identities By Ping (POST)
This API is used to link up a social provider account with an existing LoginRadius account on the basis of ping and the social providers user access token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-link-social-identities-by-ping)
 
access_token = "<access_token>" #Required 
client_guid = "<client_guid>" #Required

result = loginradius.authentication.link_social_identities_by_ping(access_token, client_guid)
Auth User Registration by Email (POST)
This API creates a user in the database as well as sends a verification email to the user. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-user-registration-by-email)

auth_user_registration_model = { 
"email" : [   { 
"type" : "<type>"  ,
"value" : "<value>"   
}  ] ,
"firstName" : "<firstName>",
"lastName" : "<lastName>",
"password" : "<password>"
}  #Required 
sott = "<sott>" #Required 
email_template = "<email_template>" #Optional 
fields = "<fields>" #Optional 
options = "<options>" #Optional 
verification_url = "<verification_url>" #Optional 
welcome_email_template = "<welcome_email_template>" #Optional

result = loginradius.authentication.user_registration_by_email(auth_user_registration_model, sott, email_template, fields, options, verification_url, welcome_email_template)
Auth User Registration By Captcha (POST)
This API creates a user in the database as well as sends a verification email to the user. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-user-registration-by-recaptcha)

auth_user_registration_model_with_captcha = { 
"email" : [   { 
"type" : "<type>"  ,
"value" : "<value>"   
}  ] ,
"firstName" : "<firstName>",
"g-recaptcha-response" : "<g-recaptcha-response>",
"lastName" : "<lastName>",
"password" : "<password>"
}  #Required 
email_template = "<email_template>" #Optional 
fields = "<fields>" #Optional 
options = "<options>" #Optional 
sms_template = "<sms_template>" #Optional 
verification_url = "<verification_url>" #Optional 
welcome_email_template = "<welcome_email_template>" #Optional

result = loginradius.authentication.user_registration_by_captcha(auth_user_registration_model_with_captcha, email_template, fields, options, sms_template, verification_url, welcome_email_template)
Get Security Questions By Email (GET)
This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-email/)
 
email = "<email>" #Required

result = loginradius.authentication.get_security_questions_by_email(email)
Get Security Questions By UserName (GET)
This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-user-name/)
 
user_name = "<user_name>" #Required

result = loginradius.authentication.get_security_questions_by_user_name(user_name)
Get Security Questions By Phone (GET)
This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-phone/)
 
phone = "<phone>" #Required

result = loginradius.authentication.get_security_questions_by_phone(phone)
Get Security Questions By Access Token (GET)
This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-access-token/)
 
access_token = "<access_token>" #Required

result = loginradius.authentication.get_security_questions_by_access_token(access_token)
Auth Validate Access token (GET)
This api validates access token, if valid then returns a response with its expiry otherwise error. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-validate-access-token/)
 
access_token = "<access_token>" #Required

result = loginradius.authentication.auth_validate_access_token(access_token)
Access Token Invalidate (GET)
This api call invalidates the active access token or expires an access token's validity. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-invalidate-access-token/)
 
access_token = "<access_token>" #Required 
prevent_refresh = "True" #Optional

result = loginradius.authentication.auth_in_validate_access_token(access_token, prevent_refresh)
Access Token Info (GET)
This api call provide the active access token Information [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-access-token-info/)
 
access_token = "<access_token>" #Required

result = loginradius.authentication.get_access_token_info(access_token)
Auth Read all Profiles by Token (GET)
This API retrieves a copy of the user data based on the access token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-read-profiles-by-token/)
 
access_token = "<access_token>" #Required 
fields = "<fields>" #Optional 
email_template = "<email_template>" #Optional 
verification_url = "<verification_url>" #Optional 
welcome_email_template = "<welcome_email_template>" #Optional

result = loginradius.authentication.get_profile_by_access_token(access_token, fields,email_template, verification_url, welcome_email_template)
Auth Send Welcome Email (GET)
This API sends a welcome email [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-send-welcome-email/)
 
access_token = "<access_token>" #Required 
welcome_email_template = "<welcome_email_template>" #Optional

result = loginradius.authentication.send_welcome_email(access_token, welcome_email_template)
Auth Delete Account (GET)
This API is used to delete an account by passing it a delete token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-delete-account/)
 
deletetoken = "<deletetoken>" #Required

result = loginradius.authentication.delete_account_by_delete_token(deletetoken)
Get Profile By Ping (GET)
This API is used to get a user's profile using the clientGuid parameter if no callback feature enabled. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/social-login-by-ping/)
 
client_guid = "<client_guid>" #Required 
email_template = "<email_template>" #Optional 
fields = "<fields>" #Optional 
verification_url = "<verification_url>" #Optional 
welcome_email_template = "<welcome_email_template>" #Optional

result = loginradius.authentication.get_profile_by_ping(client_guid, email_template, fields, verification_url, welcome_email_template)
Auth Check Email Availability (GET)
This API is used to check the email exists or not on your site. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-email-availability/)
 
email = "<email>" #Required

result = loginradius.authentication.check_email_availability(email)
Auth Verify Email (GET)
This API is used to verify the email of user. Note: This API will only return the full profile if you have 'Enable auto login after email verification' set in your LoginRadius Admin Console's Email Workflow settings under 'Verification Email'. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-verify-email/)
 
verification_token = "<verification_token>" #Required 
fields = "<fields>" #Optional 
url = "<url>" #Optional 
welcome_email_template = "<welcome_email_template>" #Optional

result = loginradius.authentication.verify_email(verification_token, fields, url, welcome_email_template)
Auth Check UserName Availability (GET)
This API is used to check the UserName exists or not on your site. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-username-availability/)
 
username = "<username>" #Required

result = loginradius.authentication.check_user_name_availability(username)
Auth Privacy Policy Accept (GET)
This API is used to update the privacy policy stored in the user's profile by providing the access token of the user accepting the privacy policy [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-privacy-policy-accept)
 
access_token = "<access_token>" #Required 
fields = "<fields>" #Optional

result = loginradius.authentication.accept_privacy_policy(access_token, fields)
Auth Privacy Policy History By Access Token (GET)
This API will return all the accepted privacy policies for the user by providing the access token of that user. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/privacy-policy-history-by-access-token/)
 
access_token = "<access_token>" #Required

result = loginradius.authentication.get_privacy_policy_history_by_access_token(access_token)
Auth Delete Account with Email Confirmation (DELETE)
This API will send a confirmation email for account deletion to the customer's email when passed the customer's access token [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-delete-account-with-email-confirmation/)
 
access_token = "<access_token>" #Required 
delete_url = "<delete_url>" #Optional 
email_template = "<email_template>" #Optional

result = loginradius.authentication.delete_account_with_email_confirmation(access_token, delete_url, email_template)
Auth Remove Email (DELETE)
This API is used to remove additional emails from a user's account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-remove-email)
 
access_token = "<access_token>" #Required 
email = "<email>" #Required

result = loginradius.authentication.remove_email(access_token, email)
Auth Unlink Social Identities (DELETE)
This API is used to unlink up a social provider account with the specified account based on the access token and the social providers user access token. The unlinked account will automatically get removed from your database. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-unlink-social-identities)
 
access_token = "<access_token>" #Required 
provider = "<provider>" #Required 
provider_id = "<provider_id>" #Required

result = loginradius.authentication.unlink_social_identities(access_token, provider, provider_id)

Account API

List of APIs in this Section:

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

account_user_profile_update_model = { 
"firstName" : "<firstName>",
"lastName" : "<lastName>"
}  #Required 
uid = "<uid>" #Required 
fields = "<fields>" #Optional 
null_support = "True" #Optional

result = loginradius.account.update_account_by_uid(account_user_profile_update_model, uid, fields, null_support)
Update Phone ID by UID (PUT)
This API is used to update the PhoneId by using the Uid's. Admin can update the PhoneId's for both the verified and unverified profiles. It will directly replace the PhoneId and bypass the OTP verification process. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/update-phoneid-by-uid)
 
phone = "<phone>" #Required 
uid = "<uid>" #Required 
fields = "<fields>" #Optional

result = loginradius.account.update_phone_id_by_uid(phone, uid, fields)
Account Set Password (PUT)
This API is used to set the password of an account in Cloud Storage. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-set-password)
 
password = "<password>" #Required 
uid = "<uid>" #Required

result = loginradius.account.set_account_password_by_uid(password, uid)
Account Invalidate Verification Email (PUT)
This API is used to invalidate the Email Verification status on an account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-invalidate-verification-email)
 
uid = "<uid>" #Required 
email_template = "<email_template>" #Optional 
verification_url = "<verification_url>" #Optional

result = loginradius.account.invalidate_account_email_verification(uid, email_template, verification_url)
Reset phone ID verification (PUT)
This API Allows you to reset the phone no verification of an end userโ€™s account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/reset-phone-id-verification)
 
uid = "<uid>" #Required 
sms_template = "<sms_template>" #Optional

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

upsert_email_model = { 
"email" : [   { 
"type" : "<type>"  ,
"value" : "<value>"   
}  ] 
}  #Required 
uid = "<uid>" #Required 
fields = "<fields>" #Optional

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

update_uid_model = { 
"newUid" : "<newUid>"
}  #Required 
uid = "<uid>" #Required

result = loginradius.account.account_update_uid(update_uid_model, uid)
Account Create (POST)
This API is used to create an account in Cloud Storage. This API bypass the normal email verification process and manually creates the user.

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

account_create_model = { 
"email" : [   { 
"type" : "<type>"  ,
"value" : "<value>"   
}  ] ,
"firstName" : "<firstName>",
"lastName" : "<lastName>",
"password" : "<password>"
}  #Required 
fields = "<fields>" #Optional

result = loginradius.account.create_account(account_create_model, fields)
Forgot Password token (POST)
This API Returns a Forgot Password Token it can also be used to send a Forgot Password email to the customer. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username' in the body. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/get-forgot-password-token)
 
email = "<email>" #Required 
email_template = "<email_template>" #Optional 
reset_password_url = "<reset_password_url>" #Optional 
send_email = "True" #Optional

result = loginradius.account.get_forgot_password_token(email, email_template, reset_password_url, send_email)
Email Verification token (POST)
This API Returns an Email Verification token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/get-email-verification-token)
 
email = "<email>" #Required

result = loginradius.account.get_email_verification_token(email)
Get Privacy Policy History By Uid (GET)
This API is used to retrieve all of the accepted Policies by the user, associated with their UID. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/privacy-policy-history-by-uid/)
 
uid = "<uid>" #Required

result = loginradius.account.get_privacy_policy_history_by_uid(uid)
Account Profiles by Email (GET)
This API is used to retrieve all of the profile data, associated with the specified account by email in Cloud Storage. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-email)
 
email = "<email>" #Required 
fields = "<fields>" #Optional

result = loginradius.account.get_account_profile_by_email(email, fields)
Account Profiles by Username (GET)
This API is used to retrieve all of the profile data associated with the specified account by user name in Cloud Storage. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-user-name)
 
user_name = "<user_name>" #Required 
fields = "<fields>" #Optional

result = loginradius.account.get_account_profile_by_user_name(user_name, fields)
Account Profile by Phone ID (GET)
This API is used to retrieve all of the profile data, associated with the account by phone number in Cloud Storage. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-phone-id/)
 
phone = "<phone>" #Required 
fields = "<fields>" #Optional

result = loginradius.account.get_account_profile_by_phone(phone, fields)
Account Profiles by UID (GET)
This API is used to retrieve all of the profile data, associated with the account by uid in Cloud Storage. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-uid)
 
uid = "<uid>" #Required 
fields = "<fields>" #Optional

result = loginradius.account.get_account_profile_by_uid(uid, fields)
Account Password (GET)
This API use to retrive the hashed password of a specified account in Cloud Storage. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-password)
 
uid = "<uid>" #Required

result = loginradius.account.get_account_password_hash_by_uid(uid)
Access Token based on UID or User impersonation API (GET)
The API is used to get LoginRadius access token based on UID. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-impersonation-api)
 
uid = "<uid>" #Required

result = loginradius.account.get_access_token_by_uid(uid)
Refresh Access Token by Refresh Token (GET)
This API is used to refresh an access token via it's associated refresh token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/refresh-access-token-by-refresh-token)
 
refresh_token = "<refresh_token>" #Required

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

result = loginradius.account.revoke_refresh_token(refresh_token)
Account Identities by Email (GET)
Note: This is intended for specific workflows where an email may be associated to multiple UIDs. This API is used to retrieve all of the identities (UID and Profiles), associated with a specified email in Cloud Storage. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-identities-by-email)
 
email = "<email>" #Required 
fields = "<fields>" #Optional

result = loginradius.account.get_account_identities_by_email(email, fields)
Account Delete (DELETE)
This API deletes the Users account and allows them to re-register for a new account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-delete)
 
uid = "<uid>" #Required

result = loginradius.account.delete_account_by_uid(uid)
Account Remove Email (DELETE)
Use this API to Remove emails from a user Account [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-email-delete)
 
email = "<email>" #Required 
uid = "<uid>" #Required 
fields = "<fields>" #Optional

result = loginradius.account.remove_email(email, uid, fields)
Delete User Profiles By Email (DELETE)
This API is used to delete all user profiles associated with an Email. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-email-delete/)
 
email = "<email>" #Required

result = loginradius.account.account_delete_by_email(email)

Social API

List of APIs in this Section:

Post Message API (POST)
Post Message API is used to post messages to the user's contacts.

Supported Providers: Twitter, LinkedIn

The Message API is used to post messages to the user?s contacts. This is one of the APIs that makes up the LoginRadius Friend Invite System. After using the Contact API, you can send messages to the retrieved contacts. This API requires setting permissions in your LoginRadius Dashboard.

GET & POST Message API work the same way except the API method is different [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/post-message-api)
 
access_token = "<access_token>" #Required 
message = "<message>" #Required 
subject = "<subject>" #Required 
to = "<to>" #Required

result = loginradius.social.post_message(access_token, message, subject, to)
Status Posting (POST)
The Status API is used to update the status on the user's wall.

Supported Providers: Facebook, Twitter, LinkedIn [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/status-posting/)
 
access_token = "<access_token>" #Required 
caption = "<caption>" #Required 
description = "<description>" #Required 
imageurl = "<imageurl>" #Required 
status = "<status>" #Required 
title = "<title>" #Required 
url = "<url>" #Required 
shorturl = "<shorturl>" #Optional

result = loginradius.social.status_posting(access_token, caption, description, imageurl, status, title, url, shorturl)
Trackable Status Posting (POST)
The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.

The Trackable Status API is used to update the status on the user's wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications.

POST Input Parameter Format: application/x-www-form-urlencoded [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/trackable-status-posting/)
 
access_token = "<access_token>" #Required
status_model = { 
"caption" : "<caption>",
"description" : "<description>",
"imageurl" : "<imageurl>",
"status" : "<status>",
"title" : "<title>",
"url" : "<url>"
}  #Required

result = loginradius.social.trackable_status_posting(access_token, status_model)
Access Token (GET)
This API Is used to translate the Request Token returned during authentication into an Access Token that can be used with other API calls. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/access-token)
 
token = "<token>" #Required

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

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

Contact LoginRadius support team to enable this API. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/refresh-token)
 
access_token = "<access_token>" #Required 
expires_in = 0 #Optional 
is_web = "True" #Optional

result = loginradius.social.refresh_access_token(access_token, expires_in, is_web)
Token Validate (GET)
This API validates access token, if valid then returns a response with its expiry otherwise error. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/validate-access-token)
 
access_token = "<access_token>" #Required

result = loginradius.social.validate_access_token(access_token)
Access Token Invalidate (GET)
This api invalidates the active access token or expires an access token validity. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/invalidate-access-token)
 
access_token = "<access_token>" #Required

result = loginradius.social.in_validate_access_token(access_token)
Get Active Session Details (GET)
This api is use to get all active session by Access Token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/get-active-session-details)
 
token = "<token>" #Required

result = loginradius.social.get_active_session(token)
Get Active Session By Account Id (GET)
This api is used to get all active sessions by AccountID(UID). [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/active-session-by-account-id/)
 
account_id = "<account_id>" #Required

result = loginradius.social.get_active_session_by_account_id(account_id)
Get Active Session By Profile Id (GET)
This api is used to get all active sessions by ProfileId. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/active-session-by-profile-id/)
 
profile_id = "<profile_id>" #Required

result = loginradius.social.get_active_session_by_profile_id(profile_id)
Album (GET)
Supported Providers: Facebook, Google, Live, Vkontakte.

This API returns the photo albums associated with the passed in access tokens Social Profile. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/album/)
 
access_token = "<access_token>" #Required

result = loginradius.social.get_albums(access_token)
Get Albums with cursor (GET)
Supported Providers: Facebook, Google, Live, Vkontakte.

This API returns the photo albums associated with the passed in access tokens Social Profile. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/album/)
 
access_token = "<access_token>" #Required 
next_cursor = "<next_cursor>" #Required

result = loginradius.social.get_albums_with_cursor(access_token, next_cursor)
Audio (GET)
The Audio API is used to get audio files data from the user's social account.

Supported Providers: Live, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/audio)
 
access_token = "<access_token>" #Required

result = loginradius.social.get_audios(access_token)
Get Audio With Cursor (GET)
The Audio API is used to get audio files data from the user's social account.

Supported Providers: Live, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/audio)
 
access_token = "<access_token>" #Required 
next_cursor = "<next_cursor>" #Required

result = loginradius.social.get_audios_with_cursor(access_token, next_cursor)
Check In (GET)
The Check In API is used to get check Ins data from the user's social account.

Supported Providers: Facebook, Foursquare, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/check-in)
 
access_token = "<access_token>" #Required

result = loginradius.social.get_check_ins(access_token)
Get CheckIns With Cursor (GET)
The Check In API is used to get check Ins data from the user's social account.

Supported Providers: Facebook, Foursquare, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/check-in)
 
access_token = "<access_token>" #Required 
next_cursor = "<next_cursor>" #Required

result = loginradius.social.get_check_ins_with_cursor(access_token, next_cursor)
Contact (GET)
The Contact API is used to get contacts/friends/connections data from the user's social account.This is one of the APIs that makes up the LoginRadius Friend Invite System. The data will normalized into LoginRadius' standard data format. This API requires setting permissions in your LoginRadius Dashboard.

Note: Facebook restricts access to the list of friends that is returned. When using the Contacts API with Facebook you will only receive friends that have accepted some permissions with your app.

Supported Providers: Facebook, Foursquare, Google, LinkedIn, Live, Twitter, Vkontakte, Yahoo [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/contact)
 
access_token = "<access_token>" #Required 
next_cursor = "<next_cursor>" #Optional

result = loginradius.social.get_contacts(access_token, next_cursor)
Event (GET)
The Event API is used to get the event data from the user's social account.

Supported Providers: Facebook, Live [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/event)
 
access_token = "<access_token>" #Required

result = loginradius.social.get_events(access_token)
Get Events With Cursor (GET)
The Event API is used to get the event data from the user's social account.

Supported Providers: Facebook, Live [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/event)
 
access_token = "<access_token>" #Required 
next_cursor = "<next_cursor>" #Required

result = loginradius.social.get_events_with_cursor(access_token, next_cursor)
Following (GET)
Get the following user list from the user's social account.

Supported Providers: Twitter [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/following)
 
access_token = "<access_token>" #Required

result = loginradius.social.get_followings(access_token)
Get Followings With Cursor (GET)
Get the following user list from the user's social account.

Supported Providers: Twitter [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/following)
 
access_token = "<access_token>" #Required 
next_cursor = "<next_cursor>" #Required

result = loginradius.social.get_followings_with_cursor(access_token, next_cursor)
Group (GET)
The Group API is used to get group data from the user's social account.

Supported Providers: Facebook, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/group)
 
access_token = "<access_token>" #Required

result = loginradius.social.get_groups(access_token)
Get Groups With Cursor (GET)
The Group API is used to get group data from the user's social account.

Supported Providers: Facebook, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/group)
 
access_token = "<access_token>" #Required 
next_cursor = "<next_cursor>" #Required

result = loginradius.social.get_groups_with_cursor(access_token, next_cursor)
Like (GET)
The Like API is used to get likes data from the user's social account.

Supported Providers: Facebook [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/like)
 
access_token = "<access_token>" #Required

result = loginradius.social.get_likes(access_token)
Get Likes With Cursor (GET)
The Like API is used to get likes data from the user's social account.

Supported Providers: Facebook [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/like)
 
access_token = "<access_token>" #Required 
next_cursor = "<next_cursor>" #Required

result = loginradius.social.get_likes_with_cursor(access_token, next_cursor)
Mention (GET)
The Mention API is used to get mentions data from the user's social account.

Supported Providers: Twitter [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/mention)
 
access_token = "<access_token>" #Required

result = loginradius.social.get_mentions(access_token)
Page (GET)
The Page API is used to get the page data from the user's social account.

Supported Providers: Facebook, LinkedIn [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/page)
 
access_token = "<access_token>" #Required 
page_name = "<page_name>" #Required

result = loginradius.social.get_page(access_token, page_name)
Photo (GET)
The Photo API is used to get photo data from the user's social account.

Supported Providers: Facebook, Foursquare, Google, Live, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/photo)
 
access_token = "<access_token>" #Required 
album_id = "<album_id>" #Required

result = loginradius.social.get_photos(access_token, album_id)
Get Post (GET)
The Post API is used to get post message data from the user's social account.

Supported Providers: Facebook [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/post)
 
access_token = "<access_token>" #Required

result = loginradius.social.get_posts(access_token)
Get Trackable Status Stats (GET)
The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.

The Trackable Status API is used to update the status on the user's wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/get-trackable-status-stats/)
 
access_token = "<access_token>" #Required 
caption = "<caption>" #Required 
description = "<description>" #Required 
imageurl = "<imageurl>" #Required 
status = "<status>" #Required 
title = "<title>" #Required 
url = "<url>" #Required

result = loginradius.social.get_trackable_status_stats(access_token, caption, description, imageurl, status, title, url)
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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/trackable-status-fetching/)
 
post_id = "<post_id>" #Required

result = loginradius.social.trackable_status_fetching(post_id)
Refresh User Profile (GET)
The User Profile API is used to get the latest updated social profile data from the user's social account after authentication. The social profile will be retrieved via oAuth and OpenID protocols. The data is normalized into LoginRadius' standard data format. This API should be called using the access token retrieved from the refresh access token API. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/refresh-user-profile)
 
access_token = "<access_token>" #Required 
fields = "<fields>" #Optional

result = loginradius.social.get_refreshed_social_user_profile(access_token, fields)
Video (GET)
The Video API is used to get video files data from the user's social account.

Supported Providers: Facebook, Google, Live, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/video)
 
access_token = "<access_token>" #Required 
next_cursor = "<next_cursor>" #Required

result = loginradius.social.get_videos(access_token, next_cursor)

CustomObject API

List of APIs in this Section:

Custom Object Update by Access Token (PUT)
This API is used to update the specified custom object data of the specified account. If the value of updatetype is 'replace' then it will fully replace custom object with the new custom object and if the value of updatetype is 'partialreplace' then it will perform an upsert type operation [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-update-by-objectrecordid-and-token)
 
access_token = "<access_token>" #Required 
object_name = "<object_name>" #Required 
object_record_id = "<object_record_id>" #Required
object = { "customdata1": "Store my customdata1 value"}  #Required 
update_type = "<update_type>" #Optional

result = loginradius.custom_object.update_custom_object_by_token(access_token, object_name, object_record_id, object, update_type)
Custom Object Update by UID (PUT)
This API is used to update the specified custom object data of a specified account. If the value of updatetype is 'replace' then it will fully replace custom object with new custom object and if the value of updatetype is partialreplace then it will perform an upsert type operation. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-update-by-objectrecordid-and-uid)
 
object_name = "<object_name>" #Required 
object_record_id = "<object_record_id>" #Required
object = { "customdata1": "Store my customdata1 value"}  #Required 
uid = "<uid>" #Required 
update_type = "<update_type>" #Optional

result = loginradius.custom_object.update_custom_object_by_uid(object_name, object_record_id, object, uid, update_type)
Create Custom Object by Token (POST)
This API is used to write information in JSON format to the custom object for the specified account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/create-custom-object-by-token)
 
access_token = "<access_token>" #Required 
object_name = "<object_name>" #Required
object = { "customdata1": "Store my customdata1 value"}  #Required

result = loginradius.custom_object.create_custom_object_by_token(access_token, object_name, object)
Create Custom Object by UID (POST)
This API is used to write information in JSON format to the custom object for the specified account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/create-custom-object-by-uid)
 
object_name = "<object_name>" #Required
object = { "customdata1": "Store my customdata1 value"}  #Required 
uid = "<uid>" #Required

result = loginradius.custom_object.create_custom_object_by_uid(object_name, object, uid)
Custom Object by Token (GET)
This API is used to retrieve the specified Custom Object data for the specified account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-by-token)
 
access_token = "<access_token>" #Required 
object_name = "<object_name>" #Required

result = loginradius.custom_object.get_custom_object_by_token(access_token, object_name)
Custom Object by ObjectRecordId and Token (GET)
This API is used to retrieve the Custom Object data for the specified account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-by-objectrecordid-and-token)
 
access_token = "<access_token>" #Required 
object_name = "<object_name>" #Required 
object_record_id = "<object_record_id>" #Required

result = loginradius.custom_object.get_custom_object_by_record_id_and_token(access_token, object_name, object_record_id)
Custom Object By UID (GET)
This API is used to retrieve all the custom objects by UID from cloud storage. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-by-uid)
 
object_name = "<object_name>" #Required 
uid = "<uid>" #Required

result = loginradius.custom_object.get_custom_object_by_uid(object_name, uid)
Custom Object by ObjectRecordId and UID (GET)
This API is used to retrieve the Custom Object data for the specified account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-by-objectrecordid-and-uid)
 
object_name = "<object_name>" #Required 
object_record_id = "<object_record_id>" #Required 
uid = "<uid>" #Required

result = loginradius.custom_object.get_custom_object_by_record_id(object_name, object_record_id, uid)
Custom Object Delete by Record Id And Token (DELETE)
This API is used to remove the specified Custom Object data using ObjectRecordId of a specified account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-delete-by-objectrecordid-and-token)
 
access_token = "<access_token>" #Required 
object_name = "<object_name>" #Required 
object_record_id = "<object_record_id>" #Required

result = loginradius.custom_object.delete_custom_object_by_token(access_token, object_name, object_record_id)
Account Delete Custom Object by ObjectRecordId (DELETE)
This API is used to remove the specified Custom Object data using ObjectRecordId of specified account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-delete-by-objectrecordid-and-uid)
 
object_name = "<object_name>" #Required 
object_record_id = "<object_record_id>" #Required 
uid = "<uid>" #Required

result = loginradius.custom_object.delete_custom_object_by_record_id(object_name, object_record_id, uid)

PhoneAuthentication API

List of APIs in this Section:

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

reset_password_by_otp_model = { 
"otp" : "<otp>",
"password" : "<password>",
"phone" : "<phone>"
}  #Required

result = loginradius.phone_authentication.reset_password_by_phone_otp(reset_password_by_otp_model)
Phone Verification OTP (PUT)
This API is used to validate the verification code sent to verify a user's phone number [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-verify-otp)
 
otp = "<otp>" #Required 
phone = "<phone>" #Required 
fields = "<fields>" #Optional 
sms_template = "<sms_template>" #Optional

result = loginradius.phone_authentication.phone_verification_by_otp(otp, phone, fields, sms_template)
Phone Verification OTP by Token (PUT)
This API is used to consume the verification code sent to verify a user's phone number. Use this call for front-end purposes in cases where the user is already logged in by passing the user's access token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-verify-otp-by-token)
 
access_token = "<access_token>" #Required 
otp = "<otp>" #Required 
sms_template = "<sms_template>" #Optional

result = loginradius.phone_authentication.phone_verification_otp_by_access_token(access_token, otp, sms_template)
Phone Number Update (PUT)
This API is used to update the login Phone Number of users [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-number-update)
 
access_token = "<access_token>" #Required 
phone = "<phone>" #Required 
sms_template = "<sms_template>" #Optional

result = loginradius.phone_authentication.update_phone_number(access_token, phone, sms_template)
Phone Login (POST)
This API retrieves a copy of the user data based on the Phone [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-login)

phone_authentication_model = { 
"password" : "<password>",
"phone" : "<phone>"
}  #Required 
fields = "<fields>" #Optional 
login_url = "<login_url>" #Optional 
sms_template = "<sms_template>" #Optional

result = loginradius.phone_authentication.login_by_phone(phone_authentication_model, fields, login_url, sms_template)
Phone Forgot Password by OTP (POST)
This API is used to send the OTP to reset the account password. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-forgot-password-by-otp)
 
phone = "<phone>" #Required 
sms_template = "<sms_template>" #Optional

result = loginradius.phone_authentication.forgot_password_by_phone_otp(phone, sms_template)
Phone Resend Verification OTP (POST)
This API is used to resend a verification OTP to verify a user's Phone Number. The user will receive a verification code that they will need to input [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-resend-otp)
 
phone = "<phone>" #Required 
sms_template = "<sms_template>" #Optional

result = loginradius.phone_authentication.phone_resend_verification_otp(phone, sms_template)
Phone Resend Verification OTP By Token (POST)
This API is used to resend a verification OTP to verify a user's Phone Number in cases in which an active token already exists [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-resend-otp-by-token)
 
access_token = "<access_token>" #Required 
phone = "<phone>" #Required 
sms_template = "<sms_template>" #Optional

result = loginradius.phone_authentication.phone_resend_verification_otp_by_token(access_token, phone, sms_template)
Phone User Registration by SMS (POST)
This API registers the new users into your Cloud Storage and triggers the phone verification process. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-user-registration-by-sms)

auth_user_registration_model = { 
"firstName" : "<firstName>",
"lastName" : "<lastName>",
"password" : "<password>",
"phoneId" : "<phoneId>"
}  #Required 
sott = "<sott>" #Required 
fields = "<fields>" #Optional 
options = "<options>" #Optional 
sms_template = "<sms_template>" #Optional 
verification_url = "<verification_url>" #Optional 
welcome_email_template = "<welcome_email_template>" #Optional

result = loginradius.phone_authentication.user_registration_by_phone(auth_user_registration_model, sott, fields, options, sms_template, verification_url, welcome_email_template)
Phone Number Availability (GET)
This API is used to check the Phone Number exists or not on your site. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-number-availability)
 
phone = "<phone>" #Required

result = loginradius.phone_authentication.check_phone_number_availability(phone)
Remove Phone ID by Access Token (DELETE)
This API is used to delete the Phone ID on a user's account via the access token [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/remove-phone-id-by-access-token)
 
access_token = "<access_token>" #Required

result = loginradius.phone_authentication.remove_phone_id_by_access_token(access_token)

MultiFactorAuthentication API

List of APIs in this Section:

Update MFA Setting (PUT)
This API is used to trigger the Multi-factor authentication settings after login for secure actions [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/update-mfa-setting/)
 
access_token = "<access_token>" #Required
multi_factor_auth_model_with_lockout = { 
"otp" : "<otp>"
}  #Required 
fields = "<fields>" #Optional

result = loginradius.mfa.mfa_update_setting(access_token, multi_factor_auth_model_with_lockout, fields)
Update MFA by Access Token (PUT)
This API is used to Enable Multi-factor authentication by access token on user login [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/google-authenticator/update-mfa-by-access-token/)
 
access_token = "<access_token>" #Required
multi_factor_auth_model_by_google_authenticator_code = { 
"googleAuthenticatorCode" : "<googleAuthenticatorCode>"
}  #Required 
fields = "<fields>" #Optional 
sms_template = "<sms_template>" #Optional

result = loginradius.mfa.mfa_update_by_access_token(access_token, multi_factor_auth_model_by_google_authenticator_code, fields, sms_template)
MFA Update Phone Number by Token (PUT)
This API is used to update the Multi-factor authentication phone number by sending the verification OTP to the provided phone number [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-update-phone-number-by-token/)
 
access_token = "<access_token>" #Required 
phone_no2_f_a = "<phone_no2_f_a>" #Required 
sms_template2_f_a = "<sms_template2_f_a>" #Optional

result = loginradius.mfa.mfa_update_phone_number_by_token(access_token, phone_no2_f_a, sms_template2_f_a)
Verify MFA Email OTP by Access Token (PUT)
This API is used to set up MFA Email OTP authenticator on profile after login. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/verify-mfa-otp-by-access-token/)
 
access_token = "<access_token>" #Required
multi_factor_auth_model_by_email_otp_with_lockout = { 
"EmailId":"emailId",
"Otp":"otp"
}  #Required

result = loginradius.mfa.mfa_validate_email_otp_by_access_token(access_token, multi_factor_auth_model_by_email_otp_with_lockout)
Update MFA Security Question by Access Token (PUT)
This API is used to set up MFA Security Question authenticator on profile after login. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/update-mfa-security-question-by-access-token)
 
access_token = "<access_token>" #Required
security_question_answer_model_by_access_token = { 
  "securityquestionanswer": [
       {
           "QuestionId": "db7****8a73e4******bd9****8c20",
           "Answer": "<answer>"
       }
   ],
    "ReplaceSecurityQuestionAnswer":"True" 
}  #Required

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

multi_factor_auth_model_with_lockout = { 
"otp" : "<otp>"
}  #Required 
second_factor_authentication_token = "<second_factor_authentication_token>" #Required 
fields = "<fields>" #Optional 
sms_template2_f_a = "<sms_template2_f_a>" #Optional
rba_browser_email_template = "<rba_browser_email_template>" #Optional 
rba_city_email_template = "<rba_city_email_template>" #Optional 
rba_country_email_template = "<rba_country_email_template>" #Optional 
rba_ip_email_template = "<rba_ip_email_template>" #Optional 

result = loginradius.mfa.mfa_validate_otp_by_phone(multi_factor_auth_model_with_lockout, second_factor_authentication_token, fields,sms_template2_f_a, rba_browser_email_template, rba_city_email_template, rba_country_email_template, rba_ip_email_template)
MFA Validate Google Auth Code (PUT)
This API is used to login via Multi-factor-authentication by passing the google authenticator code. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/google-authenticator/mfa-validate-google-auth-code/)
 
google_authenticator_code = "<google_authenticator_code>" #Required 
second_factor_authentication_token = "<second_factor_authentication_token>" #Required 
fields = "<fields>" #Optional 
rba_browser_email_template = "<rba_browser_email_template>" #Optional 
rba_city_email_template = "<rba_city_email_template>" #Optional 
rba_country_email_template = "<rba_country_email_template>" #Optional 
rba_ip_email_template = "<rba_ip_email_template>" #Optional

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

multi_factor_auth_model_by_backup_code = { 
"backupCode" : "<backupCode>"
}  #Required 
second_factor_authentication_token = "<second_factor_authentication_token>" #Required 
fields = "<fields>" #Optional 
rba_browser_email_template = "<rba_browser_email_template>" #Optional 
rba_city_email_template = "<rba_city_email_template>" #Optional 
rba_country_email_template = "<rba_country_email_template>" #Optional 
rba_ip_email_template = "<rba_ip_email_template>" #Optional

result = loginradius.mfa.mfa_validate_backup_code(multi_factor_auth_model_by_backup_code, second_factor_authentication_token, fields, rba_browser_email_template, rba_city_email_template, rba_country_email_template, rba_ip_email_template)
MFA Update Phone Number (PUT)
This API is used to update (if configured) the phone number used for Multi-factor authentication by sending the verification OTP to the provided phone number [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-update-phone-number/)
 
phone_no2_f_a = "<phone_no2_f_a>" #Required 
second_factor_authentication_token = "<second_factor_authentication_token>" #Required 
sms_template2_f_a = "<sms_template2_f_a>" #Optional

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

multi_factor_auth_model_by_email_otp = { 

   "EmailId":"email",
   "Otp":"otp"
}  #Required 
second_factor_authentication_token = "<second_factor_authentication_token>" #Required 
rba_browser_email_template = "<rba_browser_email_template>" #Optional 
rba_city_email_template = "<rba_city_email_template>" #Optional 
rba_country_email_template = "<rba_country_email_template>" #Optional 
rba_ip_email_template = "<rba_ip_email_template>" #Optional

result = loginradius.mfa.mfa_validate_email_otp(multi_factor_auth_model_by_email_otp, second_factor_authentication_token, rba_browser_email_template, rba_city_email_template, rba_country_email_template, rba_ip_email_template)
Update MFA Security Question by MFA Token (PUT)
This API is used to set the security questions on the profile with the MFA token when MFA flow is required. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/update-mfa-security-question-by-mfa-token/)

security_question_answer_update_model = { 
  "securityquestionanswer": [
       {
           "QuestionId": "db7****8a73e4******bd9****8c20",
           "Answer": "<answer>"
       }
   ]
}  #Required 
second_factor_authentication_token = "<second_factor_authentication_token>" #Required

result = loginradius.mfa.mfa_security_question_answer(security_question_answer_update_model, second_factor_authentication_token)
MFA Email Login (POST)
This API can be used to login by emailid on a Multi-factor authentication enabled LoginRadius site. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-email-login)
 
email = "<email>" #Required 
password = "<password>" #Required 
email_template = "<email_template>" #Optional 
fields = "<fields>" #Optional 
login_url = "<login_url>" #Optional 
sms_template = "<sms_template>" #Optional 
sms_template2_f_a = "<sms_template2_f_a>" #Optional 
verification_url = "<verification_url>" #Optional
email_template2_f_a = "<email_template2_f_a>" #Optional 


result = loginradius.mfa.mfa_login_by_email(email, password, email_template, fields, login_url, sms_template, sms_template2_f_a, verification_url,email_template2_f_a)
MFA UserName Login (POST)
This API can be used to login by username on a Multi-factor authentication enabled LoginRadius site. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-user-name-login)
 
password = "<password>" #Required 
username = "<username>" #Required 
email_template = "<email_template>" #Optional 
fields = "<fields>" #Optional 
login_url = "<login_url>" #Optional 
sms_template = "<sms_template>" #Optional 
sms_template2_f_a = "<sms_template2_f_a>" #Optional 
verification_url = "<verification_url>" #Optional
email_template2_f_a = "<email_template2_f_a>" #Optional 


result = loginradius.mfa.mfa_login_by_user_name(password, username, email_template, fields, login_url, sms_template, sms_template2_f_a, verification_url,email_template2_f_a)
MFA Phone Login (POST)
This API can be used to login by Phone on a Multi-factor authentication enabled LoginRadius site. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-phone-login)
 
password = "<password>" #Required 
phone = "<phone>" #Required 
email_template = "<email_template>" #Optional 
fields = "<fields>" #Optional 
login_url = "<login_url>" #Optional 
sms_template = "<sms_template>" #Optional 
sms_template2_f_a = "<sms_template2_f_a>" #Optional 
verification_url = "<verification_url>" #Optional
email_template2_f_a = "<email_template2_f_a>" #Optional 


result = loginradius.mfa.mfa_login_by_phone(password, phone, email_template, fields, login_url, sms_template, sms_template2_f_a, verification_url,email_template2_f_a)
Send MFA Email OTP by MFA Token (POST)
An API designed to send the MFA Email OTP to the email. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/send-mfa-email-otp-by-mfa-token/)

email_id_model = {
 "EmailId":"email"
}  #Required 
second_factor_authentication_token = "<second_factor_authentication_token>" #Required 
email_template2_f_a = "<email_template2_f_a>" #Optional

result = loginradius.mfa.mfa_email_otp(email_id_model, second_factor_authentication_token, email_template2_f_a)
Verify MFA Security Question by MFA Token (POST)
This API is used to resending the verification OTP to the provided phone number [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/verify-mfa-security-question-by-mfa-token/)

security_question_answer_update_model = {
  "securityquestionanswer": [
       {
           "QuestionId": "db7****8a73e4******bd9****8c20",
           "Answer": "<answer>"
       }
   ]
}  #Required 
second_factor_authentication_token = "<second_factor_authentication_token>" #Required 
rba_browser_email_template = "<rba_browser_email_template>" #Optional 
rba_city_email_template = "<rba_city_email_template>" #Optional 
rba_country_email_template = "<rba_country_email_template>" #Optional 
rba_ip_email_template = "<rba_ip_email_template>" #Optional

result = loginradius.mfa.mfa_security_question_answer_verification(security_question_answer_update_model, second_factor_authentication_token, rba_browser_email_template, rba_city_email_template, rba_country_email_template, rba_ip_email_template)
MFA Validate Access Token (GET)
This API is used to configure the Multi-factor authentication after login by using the access token when MFA is set as optional on the LoginRadius site. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-validate-access-token/)
 
access_token = "<access_token>" #Required 
sms_template2_f_a = "<sms_template2_f_a>" #Optional

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

result = loginradius.mfa.mfa_backup_code_by_access_token(access_token)
Reset Backup Code by Access Token (GET)
API is used to reset the backup codes on a given account via the access token. This API call will generate 10 new codes, each code can only be consumed once [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/mfa-reset-backup-code-by-access-token/)
 
access_token = "<access_token>" #Required

result = loginradius.mfa.mfa_reset_backup_code_by_access_token(access_token)
Send MFA Email OTP by Access Token (GET)
This API is created to send the OTP to the email if email OTP authenticator is enabled in app's MFA configuration. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/send-mfa-email-otp-by-access-token/)
 
access_token = "<access_token>" #Required 
email_id = "<email_id>" #Required 
email_template2_f_a = "<email_template2_f_a>" #Optional

result = loginradius.mfa.mfa_email_otp_by_access_token(access_token, email_id, email_template2_f_a)
MFA Resend Otp (GET)
This API is used to resending the verification OTP to the provided phone number [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/resend-twofactorauthentication-otp/)
 
second_factor_authentication_token = "<second_factor_authentication_token>" #Required 
sms_template2_f_a = "<sms_template2_f_a>" #Optional

result = loginradius.mfa.mfa_resend_otp(second_factor_authentication_token, sms_template2_f_a)
MFA Backup Code by UID (GET)
This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/mfa-backup-code-by-uid/)
 
uid = "<uid>" #Required

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

result = loginradius.mfa.mfa_reset_backup_code_by_uid(uid)
MFA Reset Google Authenticator by Token (DELETE)
This API Resets the Google Authenticator configurations on a given account via the access token [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/google-authenticator/mfa-reset-google-authenticator-by-token/)
 
access_token = "<access_token>" #Required 
googleauthenticator = "True" #Required

result = loginradius.mfa.mfa_reset_google_auth_by_token(access_token, googleauthenticator)
MFA Reset SMS Authenticator by Token (DELETE)
This API resets the SMS Authenticator configurations on a given account via the access token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-reset-sms-authenticator-by-token/)
 
access_token = "<access_token>" #Required 
otpauthenticator = "True" #Required

result = loginradius.mfa.mfa_reset_sms_auth_by_token(access_token, otpauthenticator)
Reset MFA Email OTP Authenticator By Access Token (DELETE)
This API is used to reset the Email OTP Authenticator settings for an MFA-enabled user [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/reset-mfa-email-otp-authenticator-access-token/)
 
access_token = "<access_token>" #Required

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

result = loginradius.mfa.mfa_reset_security_question_authenticator_by_access_token(access_token)
MFA Reset SMS Authenticator By UID (DELETE)
This API resets the SMS Authenticator configurations on a given account via the UID. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-reset-sms-authenticator-by-uid/)
 
otpauthenticator = "True" #Required 
uid = "<uid>" #Required

result = loginradius.mfa.mfa_reset_sms_authenticator_by_uid(otpauthenticator, uid)
MFA Reset Google Authenticator By UID (DELETE)
This API resets the Google Authenticator configurations on a given account via the UID. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/google-authenticator/mfa-reset-google-authenticator-by-uid/)
 
googleauthenticator = "True" #Required 
uid = "<uid>" #Required

result = loginradius.mfa.mfa_reset_google_authenticator_by_uid(googleauthenticator, uid)
Reset MFA Email OTP Authenticator Settings by Uid (DELETE)
This API is used to reset the Email OTP Authenticator settings for an MFA-enabled user. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/reset-mfa-email-otp-authenticator-settings-by-uid/)
 
uid = "<uid>" #Required

result = loginradius.mfa.mfa_reset_email_otp_authenticator_by_uid(uid)
Reset MFA Security Question Authenticator Settings by Uid (DELETE)
This API is used to reset the Security Question Authenticator settings for an MFA-enabled user. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/reset-mfa-security-question-authenticator-settings-by-uid/)
 
uid = "<uid>" #Required

result = loginradius.mfa.mfa_reset_security_question_authenticator_by_uid(uid)

PINAuthentication API

List of APIs in this Section:

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

reset_pin_by_reset_token = { 
"pin" : "<pin>",
"resetToken" : "<resetToken>"
}  #Required

result = loginradius.pin_authentication.reset_pin_by_reset_token(reset_pin_by_reset_token)
Reset PIN By SecurityAnswer And Email (PUT)
This API is used to reset pin using security question answer and email. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-securityanswer-and-email/)

reset_pin_by_security_question_answer_and_email_model = { 
"email" : "<email>",
"pin" : "<pin>",
"securityAnswer" : {"QuestionID":"Answer"}
}  #Required

result = loginradius.pin_authentication.reset_pin_by_email_and_security_answer(reset_pin_by_security_question_answer_and_email_model)
Reset PIN By SecurityAnswer And Username (PUT)
This API is used to reset pin using security question answer and username. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-securityanswer-and-username/)

reset_pin_by_security_question_answer_and_username_model = { 
"pin" : "<pin>",
"securityAnswer" : {"QuestionID":"Answer"},
"username" : "<username>"
}  #Required

result = loginradius.pin_authentication.reset_pin_by_username_and_security_answer(reset_pin_by_security_question_answer_and_username_model)
Reset PIN By SecurityAnswer And Phone (PUT)
This API is used to reset pin using security question answer and phone. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-securityanswer-and-phone/)

reset_pin_by_security_question_answer_and_phone_model = { 
"phone" : "<phone>",
"pin" : "<pin>",
"securityAnswer" : {"QuestionID":"Answer"}
}  #Required

result = loginradius.pin_authentication.reset_pin_by_phone_and_security_answer(reset_pin_by_security_question_answer_and_phone_model)
Change PIN By Token (PUT)
This API is used to change a user's PIN using access token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/change-pin-by-access-token/)
 
access_token = "<access_token>" #Required
change_pin_model = { 
"newPIN" : "<newPIN>",
"oldPIN" : "<oldPIN>"
}  #Required

result = loginradius.pin_authentication.change_pin_by_access_token(access_token, change_pin_model)
Reset PIN by Phone and OTP (PUT)
This API is used to reset pin using phoneId and OTP. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-phone-and-otp/)

reset_pin_by_phone_and_otp_model = { 
"otp" : "<otp>",
"phone" : "<phone>",
"pin" : "<pin>"
}  #Required

result = loginradius.pin_authentication.reset_pin_by_phone_and_otp(reset_pin_by_phone_and_otp_model)
Reset PIN by Email and OTP (PUT)
This API is used to reset pin using email and OTP. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-email-and-otp/)

reset_pin_by_email_and_otp_model = { 
"email" : "<email>",
"otp" : "<otp>",
"pin" : "<pin>"
}  #Required

result = loginradius.pin_authentication.reset_pin_by_email_and_otp(reset_pin_by_email_and_otp_model)
Reset PIN by Username and OTP (PUT)
This API is used to reset pin using username and OTP. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-username-and-otp/)

reset_pin_by_username_and_otp_model = { 
"otp" : "<otp>",
"pin" : "<pin>",
"username" : "<username>"
}  #Required

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

login_by_pin_model = { 
"pin" : "<pin>"
}  #Required 
session_token = "<session_token>" #Required

result = loginradius.pin_authentication.pin_login(login_by_pin_model, session_token)
Forgot PIN By Email (POST)
This API sends the reset pin email to specified email address. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/forgot-pin-by-email/)

forgot_pin_link_by_email_model = { 
"email" : "<email>"
}  #Required 
email_template = "<email_template>" #Optional 
reset_pin_url = "<reset_pin_url>" #Optional

result = loginradius.pin_authentication.send_forgot_pin_email_by_email(forgot_pin_link_by_email_model, email_template, reset_pin_url)
Forgot PIN By UserName (POST)
This API sends the reset pin email using username. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/forgot-pin-by-username/)

forgot_pin_link_by_user_name_model = { 
"userName" : "<userName>"
}  #Required 
email_template = "<email_template>" #Optional 
reset_pin_url = "<reset_pin_url>" #Optional

result = loginradius.pin_authentication.send_forgot_pin_email_by_username(forgot_pin_link_by_user_name_model, email_template, reset_pin_url)
Forgot PIN By Phone (POST)
This API sends the OTP to specified phone number [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/forgot-pin-by-phone/)

forgot_pin_otp_by_phone_model = { 
"phone" : "<phone>"
}  #Required 
sms_template = "<sms_template>" #Optional

result = loginradius.pin_authentication.send_forgot_pin_sms_by_phone(forgot_pin_otp_by_phone_model, sms_template)
Set PIN By PinAuthToken (POST)
This API is used to change a user's PIN using Pin Auth token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/set-pin-by-pinauthtoken/)

pin_required_model = { 
"pin" : "<pin>"
}  #Required 
pin_auth_token = "<pin_auth_token>" #Required

result = loginradius.pin_authentication.set_pin_by_pin_auth_token(pin_required_model, pin_auth_token)
Invalidate PIN Session Token (GET)
This API is used to invalidate pin session token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/invalidate-pin-session-token/)
 
session_token = "<session_token>" #Required

result = loginradius.pin_authentication.in_validate_pin_session_token(session_token)

ReAuthentication API

List of APIs in this Section:

Validate MFA by OTP (PUT)
This API is used to re-authenticate via Multi-factor authentication by passing the One Time Password received via SMS [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/mfa/re-auth-by-otp/)
 
access_token = "<access_token>" #Required
reauth_by_otp_model = { 
"otp" : "<otp>"
}  #Required

result = loginradius.re_authentication.mfa_re_authenticate_by_otp(access_token, reauth_by_otp_model)
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 device [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/mfa/re-auth-by-backup-code/)
 
access_token = "<access_token>" #Required
reauth_by_backup_code_model = { 
"backupCode" : "<backupCode>"
}  #Required

result = loginradius.re_authentication.mfa_re_authenticate_by_backup_code(access_token, reauth_by_backup_code_model)
Validate MFA by Google Authenticator Code (PUT)
This API is used to re-authenticate via Multi-factor-authentication by passing the google authenticator code [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/re-auth-by-google-authenticator-code)
 
access_token = "<access_token>" #Required
reauth_by_google_authenticator_code_model = { 
"googleAuthenticatorCode" : "<googleAuthenticatorCode>"
}  #Required

result = loginradius.re_authentication.mfa_re_authenticate_by_google_auth(access_token, reauth_by_google_authenticator_code_model)
Validate MFA by Password (PUT)
This API is used to re-authenticate via Multi-factor-authentication by passing the password [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/re-auth-by-password)
 
access_token = "<access_token>" #Required
password_event_based_auth_model_with_lockout = { 
"password" : "<password>"
}  #Required 
sms_template2_f_a = "<sms_template2_f_a>" #Optional

result = loginradius.re_authentication.mfa_re_authenticate_by_password(access_token, password_event_based_auth_model_with_lockout, sms_template2_f_a)
MFA Re-authentication by PIN (PUT)
This API is used to validate the triggered MFA authentication flow with a password. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/pin/re-auth-by-pin/)
 
access_token = "<access_token>" #Required
pin_auth_event_based_auth_model_with_lockout = { 
"pin" : "<pin>"
}  #Required 
sms_template2_f_a = "<sms_template2_f_a>" #Optional

result = loginradius.re_authentication.verify_pin_authentication(access_token, pin_auth_event_based_auth_model_with_lockout, sms_template2_f_a)
MFA Re-authentication by Email OTP (PUT)
This API is used to validate the triggered MFA authentication flow with an Email OTP. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/mfa-re-auth-by-email-otp/)
 
access_token = "<access_token>" #Required
reauth_by_email_otp_model = { 
 "EmailId":"email",
 "otp": "otp"
}  #Required

result = loginradius.re_authentication.re_auth_validate_email_otp(access_token, reauth_by_email_otp_model)
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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/mfa/re-auth-validate-mfa/)

event_based_multi_factor_token = { 
"secondFactorValidationToken" : "<secondFactorValidationToken>"
}  #Required 
uid = "<uid>" #Required

result = loginradius.re_authentication.verify_multi_factor_otp_reauthentication(event_based_multi_factor_token, uid)
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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/re-auth-validate-password/)

event_based_multi_factor_token = { 
"secondFactorValidationToken" : "<secondFactorValidationToken>"
}  #Required 
uid = "<uid>" #Required

result = loginradius.re_authentication.verify_multi_factor_password_reauthentication(event_based_multi_factor_token, uid)
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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/pin/re-auth-validate-pin/)

event_based_multi_factor_token = { 
"secondFactorValidationToken" : "<secondFactorValidationToken>"
}  #Required 
uid = "<uid>" #Required

result = loginradius.re_authentication.verify_multi_factor_pin_reauthentication(event_based_multi_factor_token, uid)
MFA Re-authentication by Security Question (POST)
This API is used to validate the triggered MFA re-authentication flow with security questions answers. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/mfa-re-authentication-by-security-question/)
 
access_token = "<access_token>" #Required
security_question_answer_update_model = { 
  "securityquestionanswer": [
       {
           "QuestionId": "db7****8a73e4******bd9****8c20",
           "Answer": "<answer>"
       }
   ]
}  #Required

result = loginradius.re_authentication.re_auth_by_security_question(access_token, security_question_answer_update_model)
Multi Factor Re-Authenticate (GET)
This API is used to trigger the Multi-Factor Autentication workflow for the provided access token [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/re-auth-trigger/)
 
access_token = "<access_token>" #Required 
sms_template2_f_a = "<sms_template2_f_a>" #Optional

result = loginradius.re_authentication.mfa_re_authenticate(access_token, sms_template2_f_a)
Send MFA Re-auth Email OTP by Access Token (GET)
This API is used to send the MFA Email OTP to the email for Re-authentication [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/send-mfa-re-auth-email-otp-by-access-token/)
 
access_token = "<access_token>" #Required 
email_id = "<email_id>" #Required 
email_template2_f_a = "<email_template2_f_a>" #Optional

result = loginradius.re_authentication.re_auth_send_email_otp(access_token, email_id, email_template2_f_a)

ConsentManagement API

List of APIs in this Section:

Update Consent By Access Token (PUT)
This API is to update consents using access token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/update-consent-by-access-token/)
 
access_token = "<access_token>" #Required
consent_update_model = { 
"consents" : [   { 
"consentOptionId" : "<consentOptionId>"  ,
"isAccepted" : "True"  
}  ] 
}  #Required

result = loginradius.consent_management.update_consent_profile_by_access_token(access_token, consent_update_model)
Consent By ConsentToken (POST)
This API is to submit consent form using consent token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/consent-by-consent-token/)
 
consent_token = "<consent_token>" #Required
consent_submit_model = { 
"data" : [   { 
"consentOptionId" : "<consentOptionId>"  ,
"isAccepted" : "True"  
}  ] ,
"events" : [   { 
"event" : "<event>"  ,
"isCustom" : "True"  
}  ] 
}  #Required

result = loginradius.consent_management.submit_consent_by_consent_token(consent_token, consent_submit_model)
Post Consent By Access Token (POST)
API to provide a way to end user to submit a consent form for particular event type. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/consent-by-access-token/)
 
access_token = "<access_token>" #Required
consent_submit_model = { 
"data" : [   { 
"consentOptionId" : "<consentOptionId>"  ,
"isAccepted" : "True"  
}  ] ,
"events" : [   { 
"event" : "<event>"  ,
"isCustom" : "True"  
}  ] 
}  #Required

result = loginradius.consent_management.submit_consent_by_access_token(access_token, consent_submit_model)
Get Consent Logs By Uid (GET)
This API is used to get the Consent logs of the user. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/consent-log-by-uid/)
 
uid = "<uid>" #Required

result = loginradius.consent_management.get_consent_logs_by_uid(uid)
Get Consent Log by Access Token (GET)
This API is used to fetch consent logs. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/consent-log-by-access-token/)
 
access_token = "<access_token>" #Required

result = loginradius.consent_management.get_consent_logs(access_token)
Get Verify Consent By Access Token (GET)
This API is used to check if consent is submitted for a particular event or not. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/verify-consent-by-access-token/)
 
access_token = "<access_token>" #Required 
event = "<event>" #Required 
is_custom = "True" #Required

result = loginradius.consent_management.verify_consent_by_access_token(access_token, event, is_custom)

SmartLogin API

List of APIs in this Section:

Smart Login Verify Token (GET)
This API verifies the provided token for Smart Login [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/smart-login/smart-login-verify-token/)
 
verification_token = "<verification_token>" #Required 
welcome_email_template = "<welcome_email_template>" #Optional

result = loginradius.smart_login.smart_login_token_verification(verification_token, welcome_email_template)
Smart Login By Email (GET)
This API sends a Smart Login link to the user's Email Id. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/smart-login/smart-login-by-email)
 
client_guid = "<client_guid>" #Required 
email = "<email>" #Required 
redirect_url = "<redirect_url>" #Optional 
smart_login_email_template = "<smart_login_email_template>" #Optional 
welcome_email_template = "<welcome_email_template>" #Optional

result = loginradius.smart_login.smart_login_by_email(client_guid, email, redirect_url, smart_login_email_template, welcome_email_template)
Smart Login By Username (GET)
This API sends a Smart Login link to the user's Email Id. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/smart-login/smart-login-by-username)
 
client_guid = "<client_guid>" #Required 
username = "<username>" #Required 
redirect_url = "<redirect_url>" #Optional 
smart_login_email_template = "<smart_login_email_template>" #Optional 
welcome_email_template = "<welcome_email_template>" #Optional

result = loginradius.smart_login.smart_login_by_user_name(client_guid, username, redirect_url, smart_login_email_template, welcome_email_template)
Smart Login Ping (GET)
This API is used to check if the Smart Login link has been clicked or not [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/smart-login/smart-login-ping)
 
client_guid = "<client_guid>" #Required 
fields = "<fields>" #Optional

result = loginradius.smart_login.smart_login_ping(client_guid, fields)

OneTouchLogin API

List of APIs in this Section:

One Touch OTP Verification (PUT)
This API is used to verify the otp for One Touch Login. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/one-touch-login/one-touch-otp-verification/)
 
otp = "<otp>" #Required 
phone = "<phone>" #Required 
fields = "<fields>" #Optional 
sms_template = "<sms_template>" #Optional

result = loginradius.one_touch_login.one_touch_login_otp_verification(otp, phone, fields, sms_template)
One Touch Login by Email (POST)
This API is used to send a link to a specified email for a frictionless login/registration [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/one-touch-login/one-touch-login-by-email-captcha/)

one_touch_login_by_email_model = { 
"clientguid" : "<clientguid>",
"email" : "<email>",
"g-recaptcha-response" : "<g-recaptcha-response>"
}  #Required 
one_touch_login_email_template = "<one_touch_login_email_template>" #Optional 
redirecturl = "<redirecturl>" #Optional 
welcomeemailtemplate = "<welcomeemailtemplate>" #Optional

result = loginradius.one_touch_login.one_touch_login_by_email(one_touch_login_by_email_model, one_touch_login_email_template, redirecturl, welcomeemailtemplate)
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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/one-touch-login/one-touch-login-by-phone-captcha/)

one_touch_login_by_phone_model = { 
"g-recaptcha-response" : "<g-recaptcha-response>",
"phone" : "<phone>"
}  #Required 
sms_template = "<sms_template>" #Optional

result = loginradius.one_touch_login.one_touch_login_by_phone(one_touch_login_by_phone_model, sms_template)
One Touch Email Verification (GET)
This API verifies the provided token for One Touch Login [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/one-touch-login/one-touch-email-verification)
 
verification_token = "<verification_token>" #Required 
welcome_email_template = "<welcome_email_template>" #Optional

result = loginradius.one_touch_login.one_touch_email_verification(verification_token, welcome_email_template)
One Touch Login Ping (GET)
This API is used to check if the One Touch Login link has been clicked or not. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/one-touch-login/one-touch-login-ping/)
 
client_guid = "<client_guid>" #Required 
fields = "<fields>" #Optional

result = loginradius.one_touch_login.one_touch_login_ping(client_guid, fields)

PasswordLessLogin API

List of APIs in this Section:

Passwordless Login Phone Verification (PUT)
This API verifies an account by OTP and allows the customer to login. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-phone-verification)

password_less_login_otp_model = { 
"otp" : "<otp>",
"phone" : "<phone>"
}  #Required 
fields = "<fields>" #Optional 
sms_template = "<sms_template>" #Optional

result = loginradius.password_less_login.passwordless_login_phone_verification(password_less_login_otp_model, fields, sms_template)
Passwordless Login Verification By Email And OTP (POST)
This API is used to verify the otp sent to the email when doing a passwordless login. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-verify-by-email-and-otp/)

password_less_login_by_email_and_otp_model = {
 "email": "<email>",
 "otp": "<otp>",
 "welcomeemailtemplate": "<welcome_email_template>"
}  #Required 
fields = "<fields>" #Optional

result = loginradius.password_less_login.passwordless_login_verification_by_email_and_otp(password_less_login_by_email_and_otp_model, fields)
Passwordless Login Verification By User Name And OTP (POST)
This API is used to verify the otp sent to the email when doing a passwordless login. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-verify-by-username-and-otp/)

password_less_login_by_user_name_and_otp_model = {
 "username": "<User name>",
 "otp": "<otp>",
 "welcomeemailtemplate": "<welcome_email_template>"
}  #Required 
fields = "<fields>" #Optional

result = loginradius.password_less_login.passwordless_login_verification_by_user_name_and_otp(password_less_login_by_user_name_and_otp_model, fields)
Passwordless Login by Phone (GET)
API can be used to send a One-time Passcode (OTP) provided that the account has a verified PhoneID [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-by-phone)
 
phone = "<phone>" #Required 
sms_template = "<sms_template>" #Optional

result = loginradius.password_less_login.passwordless_login_by_phone(phone, sms_template)
Passwordless Login By Email (GET)
This API is used to send a Passwordless Login verification link to the provided Email ID [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-by-email)
 
email = "<email>" #Required 
password_less_login_template = "<password_less_login_template>" #Optional 
verification_url = "<verification_url>" #Optional

result = loginradius.password_less_login.passwordless_login_by_email(email, password_less_login_template, verification_url)
Passwordless Login By UserName (GET)
This API is used to send a Passwordless Login Verification Link to a customer by providing their UserName [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-by-username)
 
username = "<username>" #Required 
password_less_login_template = "<password_less_login_template>" #Optional 
verification_url = "<verification_url>" #Optional

result = loginradius.password_less_login.passwordless_login_by_user_name(username, password_less_login_template, verification_url)
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 API [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-verification)
 
verification_token = "<verification_token>" #Required 
fields = "<fields>" #Optional 
welcome_email_template = "<welcome_email_template>" #Optional

result = loginradius.password_less_login.passwordless_login_verification(verification_token, fields, welcome_email_template)

Configuration API

List of APIs in this Section:

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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/configuration/get-server-time/)
 
time_difference = 0 #Optional

result = loginradius.configuration.get_server_info(time_difference)
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. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/configuration/get-configurations)
result = loginradius.configuration.get_configurations()

Role API

List of APIs in this Section:

Assign Roles by UID (PUT)
This API is used to assign your desired roles to a given user. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/assign-roles-by-uid/)

account_roles_model = { 
"roles" : [  "roles" ] 
}  #Required 
uid = "<uid>" #Required

result = loginradius.role.assign_roles_by_uid(account_roles_model, uid)
Upsert Context (PUT)
This API creates a Context with a set of Roles [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/upsert-context)

account_role_context_model = { 
"roleContext" : [   { 
 "additionalPermissions" : ["<additionalPermissions>" ] ,
"context" : "<context>"  ,
"expiration" : "<expiration>"  ,
 "roles" : ["<roles>" ]  
}  ] 
}  #Required 
uid = "<uid>" #Required

result = loginradius.role.update_role_context_by_uid(account_role_context_model, uid)
Add Permissions to Role (PUT)
This API is used to add permissions to a given role. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/add-permissions-to-role)

permissions_model = { 
"permissions" : [  "permissions" ] 
}  #Required 
role = "<role>" #Required

result = loginradius.role.add_role_permissions(permissions_model, role)
Roles Create (POST)
This API creates a role with permissions. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/roles-create)

roles_model = { 
"roles" : [   { 
"name" : "<name>"  ,
"permissions" : {"Permission_name" : "True"}  
}  ] 
}  #Required

result = loginradius.role.create_roles(roles_model)
Roles by UID (GET)
API is used to retrieve all the assigned roles of a particular User. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/get-roles-by-uid)
 
uid = "<uid>" #Required

result = loginradius.role.get_roles_by_uid(uid)
Get Context with Roles and Permissions (GET)
This API Gets the contexts that have been configured and the associated roles and permissions. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/get-context)
 
uid = "<uid>" #Required

result = loginradius.role.get_role_context_by_uid(uid)
Role Context profile (GET)
The API is used to retrieve role context by the context name. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/role-context-profile/)
 
context_name = "<context_name>" #Required

result = loginradius.role.get_role_context_by_context_name(context_name)
Roles List (GET)
This API retrieves the complete list of created roles with permissions of your app. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/roles-list)


result = loginradius.role.get_roles_list()
Unassign Roles by UID (DELETE)
This API is used to unassign roles from a user. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/unassign-roles-by-uid)

account_roles_model = { 
"roles" : [  "roles" ] 
}  #Required 
uid = "<uid>" #Required

result = loginradius.role.unassign_roles_by_uid(account_roles_model, uid)
Delete Role Context (DELETE)
This API Deletes the specified Role Context [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/delete-context)
 
context_name = "<context_name>" #Required 
uid = "<uid>" #Required

result = loginradius.role.delete_role_context_by_uid(context_name, uid)
Delete Role from Context (DELETE)
This API Deletes the specified Role from a Context. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/delete-role-from-context/)
 
context_name = "<context_name>" #Required
role_context_remove_role_model = { 
"roles" : [  "roles" ] 
}  #Required 
uid = "<uid>" #Required

result = loginradius.role.delete_roles_from_role_context_by_uid(context_name, role_context_remove_role_model, uid)
Delete Additional Permission from Context (DELETE)
This API Deletes Additional Permissions from Context. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/delete-permissions-from-context)
 
context_name = "<context_name>" #Required
role_context_additional_permission_remove_role_model = { 
"additionalPermissions" : [  "additionalPermissions" ] 
}  #Required 
uid = "<uid>" #Required

result = loginradius.role.delete_additional_permission_from_role_context_by_uid(context_name, role_context_additional_permission_remove_role_model, uid)
Account Delete Role (DELETE)
This API is used to delete the role. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/delete-role)
 
role = "<role>" #Required

result = loginradius.role.delete_role(role)
Remove Permissions (DELETE)
API is used to remove permissions from a role. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/remove-permissions)

permissions_model = { 
"permissions" : [  "permissions" ] 
}  #Required 
role = "<role>" #Required

result = loginradius.role.remove_role_permissions(permissions_model, role)

CustomRegistrationData API

List of APIs in this Section:

Update Registration Data (PUT)
This API allows you to update a dropdown item [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-registration-data/update-registration-data)

registration_data_update_model = { 
"isActive" : "True",
"key" : "<key>",
"type" : "<type>",
"value" : "<value>"
}  #Required 
record_id = "<record_id>" #Required

result = loginradius.custom_registration_data.update_registration_data(registration_data_update_model, record_id)
Validate secret code (POST)
This API allows you to validate code for a particular dropdown member. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-registration-data/validate-code)
 
code = "<code>" #Required 
record_id = "<record_id>" #Required

result = loginradius.custom_registration_data.validate_registration_data_code(code, record_id)
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 Overview [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-registration-data/add-registration-data)

registration_data_create_model_list = { 
"data" : [   { 
"code" : "<code>"  ,
"isActive" : "True" ,
"key" : "<key>"  ,
"parentId" : "<parentId>"  ,
"type" : "<type>"  ,
"value" : "<value>"   
}  ] 
}  #Required

result = loginradius.custom_registration_data.add_registration_data(registration_data_create_model_list)
Auth Get Registration Data Server (GET)
This API is used to retrieve dropdown data. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-registration-data/auth-get-registration-data)
 
type = "<type>" #Required 
limit = 0 #Optional 
parent_id = "<parent_id>" #Optional 
skip = 0 #Optional

result = loginradius.custom_registration_data.auth_get_registration_data(type, limit, parent_id, skip)
Get Registration Data (GET)
This API is used to retrieve dropdown data. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-registration-data/get-registration-data)
 
type = "<type>" #Required 
limit = 0 #Optional 
parent_id = "<parent_id>" #Optional 
skip = 0 #Optional

result = loginradius.custom_registration_data.get_registration_data(type, limit, parent_id, skip)
Delete Registration Data (DELETE)
This API allows you to delete an item from a dropdown list. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-registration-data/delete-registration-data)
 
record_id = "<record_id>" #Required

result = loginradius.custom_registration_data.delete_registration_data(record_id)
Delete All Records by Datasource (DELETE)
This API allows you to delete all records contained in a datasource. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-registration-data/delete-all-records-by-datasource)
 
type = "<type>" #Required

result = loginradius.custom_registration_data.delete_all_records_by_data_source(type)

RiskBasedAuthentication API

List of APIs in this Section:

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

email_authentication_model = { 
"email" : "<email>",
"password" : "<password>"
}  #Required 
email_template = "<email_template>" #Optional 
fields = "<fields>" #Optional 
login_url = "<login_url>" #Optional 
password_delegation = "True" #Optional 
password_delegation_app = "<password_delegation_app>" #Optional 
rba_browser_email_template = "<rba_browser_email_template>" #Optional 
rba_browser_sms_template = "<rba_browser_sms_template>" #Optional 
rba_city_email_template = "<rba_city_email_template>" #Optional 
rba_city_sms_template = "<rba_city_sms_template>" #Optional 
rba_country_email_template = "<rba_country_email_template>" #Optional 
rba_country_sms_template = "<rba_country_sms_template>" #Optional 
rba_ip_email_template = "<rba_ip_email_template>" #Optional 
rba_ip_sms_template = "<rba_ip_sms_template>" #Optional 
rba_oneclick_email_template = "<rba_oneclick_email_template>" #Optional 
rba_otp_sms_template = "<rba_otp_sms_template>" #Optional 
sms_template = "<sms_template>" #Optional 
verification_url = "<verification_url>" #Optional

result = loginradius.risk_based_authentication.rba_login_by_email(email_authentication_model, email_template, fields, login_url, password_delegation, password_delegation_app, rba_browser_email_template, rba_browser_sms_template, rba_city_email_template, rba_city_sms_template, rba_country_email_template, rba_country_sms_template, rba_ip_email_template, rba_ip_sms_template, rba_oneclick_email_template, rba_otp_sms_template, sms_template, verification_url)
Risk Based Authentication Login by Username (POST)
This API retrieves a copy of the user data based on the Username [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-login-by-username)

user_name_authentication_model = { 
"password" : "<password>",
"username" : "<username>"
}  #Required 
email_template = "<email_template>" #Optional 
fields = "<fields>" #Optional 
login_url = "<login_url>" #Optional 
password_delegation = "True" #Optional 
password_delegation_app = "<password_delegation_app>" #Optional 
rba_browser_email_template = "<rba_browser_email_template>" #Optional 
rba_browser_sms_template = "<rba_browser_sms_template>" #Optional 
rba_city_email_template = "<rba_city_email_template>" #Optional 
rba_city_sms_template = "<rba_city_sms_template>" #Optional 
rba_country_email_template = "<rba_country_email_template>" #Optional 
rba_country_sms_template = "<rba_country_sms_template>" #Optional 
rba_ip_email_template = "<rba_ip_email_template>" #Optional 
rba_ip_sms_template = "<rba_ip_sms_template>" #Optional 
rba_oneclick_email_template = "<rba_oneclick_email_template>" #Optional 
rba_otp_sms_template = "<rba_otp_sms_template>" #Optional 
sms_template = "<sms_template>" #Optional 
verification_url = "<verification_url>" #Optional

result = loginradius.risk_based_authentication.rba_login_by_user_name(user_name_authentication_model, email_template, fields, login_url, password_delegation, password_delegation_app, rba_browser_email_template, rba_browser_sms_template, rba_city_email_template, rba_city_sms_template, rba_country_email_template, rba_country_sms_template, rba_ip_email_template, rba_ip_sms_template, rba_oneclick_email_template, rba_otp_sms_template, sms_template, verification_url)
Risk Based Authentication Phone Login (POST)
This API retrieves a copy of the user data based on the Phone [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-login)

phone_authentication_model = { 
"password" : "<password>",
"phone" : "<phone>"
}  #Required 
email_template = "<email_template>" #Optional 
fields = "<fields>" #Optional 
login_url = "<login_url>" #Optional 
password_delegation = "True" #Optional 
password_delegation_app = "<password_delegation_app>" #Optional 
rba_browser_email_template = "<rba_browser_email_template>" #Optional 
rba_browser_sms_template = "<rba_browser_sms_template>" #Optional 
rba_city_email_template = "<rba_city_email_template>" #Optional 
rba_city_sms_template = "<rba_city_sms_template>" #Optional 
rba_country_email_template = "<rba_country_email_template>" #Optional 
rba_country_sms_template = "<rba_country_sms_template>" #Optional 
rba_ip_email_template = "<rba_ip_email_template>" #Optional 
rba_ip_sms_template = "<rba_ip_sms_template>" #Optional 
rba_oneclick_email_template = "<rba_oneclick_email_template>" #Optional 
rba_otp_sms_template = "<rba_otp_sms_template>" #Optional 
sms_template = "<sms_template>" #Optional 
verification_url = "<verification_url>" #Optional

result = loginradius.risk_based_authentication.rba_login_by_phone(phone_authentication_model, email_template, fields, login_url, password_delegation, password_delegation_app, rba_browser_email_template, rba_browser_sms_template, rba_city_email_template, rba_city_sms_template, rba_country_email_template, rba_country_sms_template, rba_ip_email_template, rba_ip_sms_template, rba_oneclick_email_template, rba_otp_sms_template, sms_template, verification_url)

Sott API

List of APIs in this Section:

Generate SOTT (GET)
This API allows you to generate SOTT with a given expiration time. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/session/generate-sott-token)
 
time_difference = 0 #Optional

result = loginradius.sott.generate_sott(time_difference)

NativeSocial API

List of APIs in this Section:

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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-facebook-token/)
 
fb_access_token = "<fb_access_token>" #Required 
social_app_name = "<social_app_name>" #Optional

result = loginradius.native_social.get_access_token_by_facebook_access_token(fb_access_token, social_app_name)
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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-twitter-token)
 
tw_access_token = "<tw_access_token>" #Required 
tw_token_secret = "<tw_token_secret>" #Required 
social_app_name = "<social_app_name>" #Optional

result = loginradius.native_social.get_access_token_by_twitter_access_token(tw_access_token, tw_token_secret, social_app_name)
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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-google-token)
 
google_access_token = "<google_access_token>" #Required 
client_id = "<client_id>" #Optional 
refresh_token = "<refresh_token>" #Optional 
social_app_name = "<social_app_name>" #Optional

result = loginradius.native_social.get_access_token_by_google_access_token(google_access_token, client_id, refresh_token, social_app_name)
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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-googlejwt)
 
id_token = "<id_token>" #Required

result = loginradius.native_social.get_access_token_by_google_j_w_t_access_token(id_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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-linkedin-token/)
 
ln_access_token = "<ln_access_token>" #Required 
social_app_name = "<social_app_name>" #Optional

result = loginradius.native_social.get_access_token_by_linkedin_access_token(ln_access_token, social_app_name)
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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-foursquare-token/)
 
fs_access_token = "<fs_access_token>" #Required

result = loginradius.native_social.get_access_token_by_foursquare_access_token(fs_access_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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-apple-id-code)
 
code = "<code>" #Required 
social_app_name = "<social_app_name>" #Optional

result = loginradius.native_social.get_access_token_by_apple_id_code(code, social_app_name)
Access Token via WeChat Code (GET)
This API is used to retrieve a LoginRadius access token by passing in a valid WeChat OAuth Code. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-wechat-code)
 
code = "<code>" #Required

result = loginradius.native_social.get_access_token_by_we_chat_code(code)
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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-vkontakte-token)
 
vk_access_token = "<vk_access_token>" #Required

result = loginradius.native_social.get_access_token_by_vkontakte_access_token(vk_access_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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-google-auth-code)
 
google_authcode = "<google_authcode>" #Required 
social_app_name = "<social_app_name>" #Optional

result = loginradius.native_social.get_access_token_by_google_auth_code(google_authcode, social_app_name)

WebHook API

List of APIs in this Section:

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. [More Info](https://www.loginradius.com/docs/api/v2/integrations/webhooks/webhook-subscribe)

web_hook_subscribe_model = { 
"event" : "<event>",
"targetUrl" : "<targetUrl>"
}  #Required

result = loginradius.web_hook.web_hook_subscribe(web_hook_subscribe_model)
Webhook Subscribed URLs (GET)
This API is used to fatch all the subscribed URLs, for particular event [More Info](https://www.loginradius.com/docs/api/v2/integrations/webhooks/webhook-subscribed-urls)
 
event = "<event>" #Required

result = loginradius.web_hook.get_web_hook_subscribed_u_r_ls(event)
Webhook Test (GET)
API can be used to test a subscribed WebHook. [More Info](https://www.loginradius.com/docs/api/v2/integrations/webhooks/webhook-test)


result = loginradius.web_hook.webhook_test()
WebHook Unsubscribe (DELETE)
API can be used to unsubscribe a WebHook configured on your LoginRadius site. [More Info](https://www.loginradius.com/docs/api/v2/integrations/webhooks/webhook-unsubscribe)

web_hook_subscribe_model = { 
"event" : "<event>",
"targetUrl" : "<targetUrl>"
}  #Required

result = loginradius.web_hook.web_hook_unsubscribe(web_hook_subscribe_model)

Error Handling

If the request fails, it can be handled in the following way:

if result.get('ErrorCode') is not None:
    print(result.get('Description'))
else:
    print(result)

## Demo We have a demo web application using the Python SDK, which includes the following features:
  • Traditional email login
  • Multi-Factor login
  • Passwordless login
  • Social login
  • Register
  • Email verification
  • Forgot password
  • Reset password
  • Change password
  • Set password
  • Update account
  • Account linking
  • Custom object management
  • Roles management

You can get a copy of our demo project at GitHub.


Configuration

1.Have Flask, requests, pbkdf2, cryptography installed or you can install the required dependency using the following command:

pip install -r requirements.txt

2.Fill in credentials in lr.py and static/js/options.js

3.Navigate to demo directory and run: python app.py

4.Demo will appear on http://localhost:5000

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.