Phone Authentication

Phone Reset Password by OTP

copy-icon
curl -X PUT \
'https://api.loginradius.com/identity/v2/auth/password/otp?apikey=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \
-d "{ "otp" : "<otp>","password" : "<password>","phone" : "<phone>" }"

The above command returns JSON structured like this:

copy-icon
{
"IsPosted" : true
}

This API is used to reset the password

HTTP Request

Put /identity/v2/auth/password/otp?apikey=

Query Parameters

ParameterDefaultDescription
apikeynoneLoginRadius API Key [Required]

Body Attributes

AttributeDescription
otpThe Verification Code
passwordPassword for the email
PhoneNew Phone NumberModel Class containing Definition of payload for ResetPasswordByOTP API [Required]

Phone Verification OTP

copy-icon
curl -X PUT \
'https://api.loginradius.com/identity/v2/auth/phone/otp?apikey=&Otp=&Fields=&SmsTemplate=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \

The above command returns JSON structured like this:

copy-icon
{
"Profile" : {
},
"access_token" : "Uniquely generated identifier key by LoginRadius that is activated after successful authentication.",
"expires_in" : "Expiration time of Access Token",
"refresh_token" : "refresh token to refresh access token",
"session_expires_in" : "session token expiry time",
"session_token" : "session token of user"
}

This API is used to validate the verification code sent to verify a user's phone number

HTTP Request

Put /identity/v2/auth/phone/otp?apikey=&Otp=&Fields=&SmsTemplate=

Query Parameters

ParameterDefaultDescription
apikeynoneLoginRadius API Key [Required]
OtpnoneThe Verification Code [Required]
FieldsnoneThe fields parameter filters the API response so that the response only includes a specific set of fields [Optional]
SmsTemplatenoneSMS Template name [Optional]

Phone Verification OTP by Token

copy-icon
curl -X PUT \
'https://api.loginradius.com/identity/v2/auth/phone/otp?access_token=&apikey=&Otp=&SmsTemplate=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \
-H 'Authorization: Bearer ' \

The above command returns JSON structured like this:

copy-icon
{
"IsPosted" : true
}

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.

HTTP Request

Put /identity/v2/auth/phone/otp?access_token=&apikey=&Otp=&SmsTemplate=

Query Parameters

ParameterDefaultDescription
access_tokennoneUniquely generated identifier key by LoginRadius that is activated after successful authentication. [Required]
apikeynoneLoginRadius API Key [Required]
OtpnoneThe Verification Code [Required]
SmsTemplatenoneSMS Template name [Optional]

Phone Number Update

copy-icon
curl -X PUT \
'https://api.loginradius.com/identity/v2/auth/phone?access_token=&apikey=&SmsTemplate=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \
-H 'Authorization: Bearer ' \

The above command returns JSON structured like this:

copy-icon
{
"Data" : {
},
"IsPosted" : true
}

This API is used to update the login Phone Number of users

HTTP Request

Put /identity/v2/auth/phone?access_token=&apikey=&SmsTemplate=

Query Parameters

ParameterDefaultDescription
access_tokennoneUniquely generated identifier key by LoginRadius that is activated after successful authentication. [Required]
apikeynoneLoginRadius API Key [Required]
SmsTemplatenoneSMS Template name [Optional]

Phone Login

copy-icon
curl -X POST \
'https://api.loginradius.com/identity/v2/auth/login?apikey=&Fields=&LoginUrl=&SmsTemplate=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \
-d "{ "password" : "<password>","phone" : "<phone>" }"

The above command returns JSON structured like this:

copy-icon
{
"Profile" : {
},
"access_token" : "Uniquely generated identifier key by LoginRadius that is activated after successful authentication.",
"expires_in" : "Expiration time of Access Token",
"refresh_token" : "refresh token to refresh access token",
"session_expires_in" : "session token expiry time",
"session_token" : "session token of user"
}

This API retrieves a copy of the user data based on the Phone

HTTP Request

Post /identity/v2/auth/login?apikey=&Fields=&LoginUrl=&SmsTemplate=

Query Parameters

ParameterDefaultDescription
apikeynoneLoginRadius API Key [Required]
FieldsnoneThe fields parameter filters the API response so that the response only includes a specific set of fields [Optional]
LoginUrlnoneUrl where the user is logging from [Optional]
SmsTemplatenoneSMS Template name [Optional]

Body Attributes

AttributeDescription
passwordPassword for the email
phoneNew Phone NumberModel Class containing Definition of payload for PhoneAuthenticationModel API [Required]

Phone Forgot Password by OTP

copy-icon
curl -X POST \
'https://api.loginradius.com/identity/v2/auth/password/otp?apikey=&SmsTemplate=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \

The above command returns JSON structured like this:

copy-icon
{
"Data" : {
},
"IsPosted" : true
}

This API is used to send the OTP to reset the account password.

HTTP Request

Post /identity/v2/auth/password/otp?apikey=&SmsTemplate=

Query Parameters

ParameterDefaultDescription
apikeynoneLoginRadius API Key [Required]
SmsTemplatenoneSMS Template name [Optional]

Phone Resend Verification OTP

copy-icon
curl -X POST \
'https://api.loginradius.com/identity/v2/auth/phone/otp?apikey=&SmsTemplate=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \

The above command returns JSON structured like this:

copy-icon
{
"Data" : {
},
"IsPosted" : true
}

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

HTTP Request

Post /identity/v2/auth/phone/otp?apikey=&SmsTemplate=

Query Parameters

ParameterDefaultDescription
apikeynoneLoginRadius API Key [Required]
SmsTemplatenoneSMS Template name [Optional]

Phone Resend Verification OTP By Token

copy-icon
curl -X POST \
'https://api.loginradius.com/identity/v2/auth/phone/otp?access_token=&apikey=&SmsTemplate=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \
-H 'Authorization: Bearer ' \

The above command returns JSON structured like this:

copy-icon
{
"Data" : {
},
"IsPosted" : true
}

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

HTTP Request

Post /identity/v2/auth/phone/otp?access_token=&apikey=&SmsTemplate=

Query Parameters

ParameterDefaultDescription
access_tokennoneUniquely generated identifier key by LoginRadius that is activated after successful authentication. [Required]
apikeynoneLoginRadius API Key [Required]
SmsTemplatenoneSMS Template name [Optional]

Phone User Registration by SMS

copy-icon
curl -X POST \
'https://api.loginradius.com/identity/v2/auth/register?apikey=&sott=&Fields=&Options=&SmsTemplate=&VerificationUrl=&WelcomeEmailTemplate=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \
-d "{ "firstName" : "<firstName>","lastName" : "<lastName>","password" : "<password>","phoneId" : "<phoneId>" }"

The above command returns JSON structured like this:

copy-icon
{
"Data" : {
},
"IsPosted" : true
}

This API registers the new users into your Cloud Storage and triggers the phone verification process.

HTTP Request

Post /identity/v2/auth/register?apikey=&sott=&Fields=&Options=&SmsTemplate=&VerificationUrl=&WelcomeEmailTemplate=

Query Parameters

ParameterDefaultDescription
apikeynoneLoginRadius API Key [Required]
sottnoneLoginRadius Secured One Time Token [Required]
FieldsnoneThe fields parameter filters the API response so that the response only includes a specific set of fields [Optional]
OptionsnonePreventVerificationEmail (Specifying this value prevents the verification email from being sent. Only applicable if you have the optional email verification flow) [Optional]
SmsTemplatenoneSMS Template name [Optional]
VerificationUrlnoneEmail verification url [Optional]
WelcomeEmailTemplatenoneName of the welcome email template [Optional]

Body Attributes

AttributeDescription
FirstNameuser's first name
LastNameuser's last name
PasswordPassword for the email
PhoneIdPhone ID (Unique Phone Number Identifier of the user)Model Class containing Definition of payload for Auth User Registration API [Required]

Phone Number Availability

copy-icon
curl -X GET \
'https://api.loginradius.com/identity/v2/auth/phone?apikey=&Phone=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \

The above command returns JSON structured like this:

copy-icon
{
"IsExist" : true
}

This API is used to check the Phone Number exists or not on your site.

HTTP Request

Get /identity/v2/auth/phone?apikey=&Phone=

Query Parameters

ParameterDefaultDescription
apikeynoneLoginRadius API Key [Required]
PhonenoneThe Registered Phone Number [Required]

Remove Phone ID by Access Token

copy-icon
curl -X DELETE \
'https://api.loginradius.com/identity/v2/auth/phone?access_token=&apikey=' \
-H 'Cache-Control: no-cache' \
-H 'content-Type: application/json' \
-H 'Authorization: Bearer ' \

The above command returns JSON structured like this:

copy-icon
{
"IsDeleted" : true,
"RecordsDeleted" : 0
}

This API is used to delete the Phone ID on a user's account via the access token

HTTP Request

Delete /identity/v2/auth/phone?access_token=&apikey=

Query Parameters

ParameterDefaultDescription
access_tokennoneUniquely generated identifier key by LoginRadius that is activated after successful authentication. [Required]
apikeynoneLoginRadius API Key [Required]