Sends a message including an OTP code to the given phone number
POST/otpvalidation/send-code
Sends an SMS with the desired message and an OTP code to the received phone number.
Body ParametersJSON
message: string
Message template used to compose the content of the SMS sent to the phone number. It must include the following label indicating where to include the short code {{code}}
maxLength160
phoneNumber: string
A public identifier addressing a telephone subscription. In mobile networks it corresponds to the MSISDN (Mobile Station International Subscriber Directory Number). In order to be globally unique it has to be formatted in international format, according to E.164 standard, prefixed with ’+’.
Sends a message including an OTP code to the given phone number
curl https://api.example.com/camara/otpvalidation/send-code \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CAMARA_BEARER_TOKEN" \
-d '{
"message": "{{code}} is your short code to authenticate with Cool App via SMS",
"phoneNumber": "+346661113334"
}'{
"authenticationId": "ea0840f3-3663-4149-bd10-c7c6b8912105"
}{
"status": 400,
"code": "INVALID_ARGUMENT",
"message": "Client specified an invalid argument, request body or query param."
}{
"status": 401,
"code": "UNAUTHENTICATED",
"message": "Request not authenticated due to missing, invalid, or expired credentials."
}{
"status": 403,
"code": "PERMISSION_DENIED",
"message": "Client does not have sufficient permissions to perform this action"
}{
"status": 403,
"code": "ONE_TIME_PASSWORD_SMS.MAX_OTP_CODES_EXCEEDED",
"message": "Too many OTPs have been requested for this MSISDN. Try later."
}{
"status": 403,
"code": "ONE_TIME_PASSWORD_SMS.PHONE_NUMBER_NOT_ALLOWED",
"message": "Phone_number can't receive an SMS due to business reasons in the operator."
}{
"status": 403,
"code": "ONE_TIME_PASSWORD_SMS.PHONE_NUMBER_BLOCKED",
"message": "Phone_number is blocked to receive SMS due to any blocking business reason in the operator."
}{
"status": 404,
"code": "NOT_FOUND",
"message": "The specified resource is not found."
}{
"status": 429,
"code": "QUOTA_EXCEEDED",
"message": "Out of resource quota."
}{
"status": 429,
"code": "TOO_MANY_REQUESTS",
"message": "Rate limit reached."
}Returns Examples
{
"authenticationId": "ea0840f3-3663-4149-bd10-c7c6b8912105"
}{
"status": 400,
"code": "INVALID_ARGUMENT",
"message": "Client specified an invalid argument, request body or query param."
}{
"status": 401,
"code": "UNAUTHENTICATED",
"message": "Request not authenticated due to missing, invalid, or expired credentials."
}{
"status": 403,
"code": "PERMISSION_DENIED",
"message": "Client does not have sufficient permissions to perform this action"
}{
"status": 403,
"code": "ONE_TIME_PASSWORD_SMS.MAX_OTP_CODES_EXCEEDED",
"message": "Too many OTPs have been requested for this MSISDN. Try later."
}{
"status": 403,
"code": "ONE_TIME_PASSWORD_SMS.PHONE_NUMBER_NOT_ALLOWED",
"message": "Phone_number can't receive an SMS due to business reasons in the operator."
}{
"status": 403,
"code": "ONE_TIME_PASSWORD_SMS.PHONE_NUMBER_BLOCKED",
"message": "Phone_number is blocked to receive SMS due to any blocking business reason in the operator."
}{
"status": 404,
"code": "NOT_FOUND",
"message": "The specified resource is not found."
}{
"status": 429,
"code": "QUOTA_EXCEEDED",
"message": "Out of resource quota."
}{
"status": 429,
"code": "TOO_MANY_REQUESTS",
"message": "Rate limit reached."
}