Skip to main content

Send Verification SMS

This request sends an outbound message with a unique code generated by the system.

post /verification/sms

A verification SMS message has the same structure as a normal SMS message, but the direction will always be outbound and the message string will include a code generated by the system.

note

Please note that to be able to send verification text messages, the rented phone number must be SMS/MMS enabled and have the appropriate active_capabilities attribute value set: 2 for sending messages, or 3 for both receiving and sending messages.

Sample

A sample POST request to send a verification SMS:

curl -X POST \
'https://api.carrierx.com/core/v2/verification/sms?from=15162065574&to=18057224756&message=Your+verification+code+is+' \
-H 'Authorization: Bearer 5ebc03d6-8b2b-44ad-bf65-72d4f1491dda'

Response

200 status code with a serialized copy of the response object:

{
"code": "6664",
"message_sid": "bd874824-826c-4c7b-860b-6da705c8d2e8"
}

Required Scopes

To send a verification SMS message, the partner must have one of the following scopes enabled:

  • verification.manage
  • verification.create

Query Arguments

ParameterData TypeDescription
allow_short_codebooleanAllow sending verification message from a short code, if any short code is associated with the DID group. The default value is true.
code_lengthintegerThe length of the verification code.
code_typestringThe type of code to generate. Values accepted in this field are:
  • alphabetical
  • alphabetical_lower
  • alphabetical_upper
  • alphanumeric
  • alphanumeric_lower
  • alphanumeric_upper
  • numeric
did_group_sidstringThe DID group secure ID.
from requiredstringThe phone number of the message originator in the E.164 format. Note, that legacy users may still see the old naming instead (from_did).
messagestringThe message to be shown before the unique code. The default string is "Your verification code is".
to requiredstringThe phone number of the recipient in the E.164 format. Note, that legacy users may still see the old naming instead (to_did).

Refer to this table to view all fields that appear in the SMS object.