SMS One-Time Password (OTP) set up request.
This endpoint is used to set up SMS OTP based two-factor authentication.
Upon receiving a valid mobile phone number (two_factor_mobile
) it will send a verification code via SMS to the supplied mobile phone number
and return a status code of 422 Unprocessable Entity.
You will then need to verify receipt of the code by submitting the code (two_factor_sms_token
) AND the mobile phone number (two_factor_mobile
) in a subsequent request to the endpoint.
If the submitted two_factor_sms_token
is invalid we will return a status code of 422 Unprocessable Entity.
Upon receipt of a valid mobile phone number AND a verified code the endpoint will return a status code of 200 OK.
Headers
-
Content-Type string
-
Accept string
Body Required
-
The mobile number that 2FA tokens should be sent to.
Format defaults to GB (+447539995949).
You can provide an array["country" => "AU", "number" => "+61 2 3456 7890"]
if you want to use a different format. -
two_factor_sms_token string
The 6-digit token/code that was present in the SMS sent to the mobile number.
Required after a valid mobile number has been provided.
curl \
-X POST https://api.plannrcrm.com/api/v1/me/sms/setup \
-H "Authorization: Bearer {OAUTH_ACCESS_TOKEN or PERSONAL_ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"two_factor_mobile":"07539995949","two_factor_sms_token":"123789"}'
# Headers
Authorization: Bearer {OAUTH_ACCESS_TOKEN or PERSONAL_ACCESS_TOKEN}
Content-Type: application/json
Accept: application/json
# Payload
{
"two_factor_mobile": "07539995949",
"two_factor_sms_token": "123789"
}
{
"errors": {
"two_factor_mobile": [
"Please enter a valid mobile phone number. If there is no country specified, we will assume the phone number is a GB number."
]
},
"message": "Please enter a valid mobile phone number. If there is no country specified, we will assume the phone number is a GB number."
}
{
"errors": {
"two_factor_sms_token": "Please enter the authentication code that we've sent to your mobile phone."
},
"message": "Please enter the authentication code that we've sent to your mobile phone."
}
{
"errors": {
"two_factor_sms_token": "The authentication code is incorrect."
},
"message": "The authentication code is incorrect."
}
{"status":"SMS OTP setup complete using mobile phone number +447539995949."}}