Send verified SMS

Description

SMS is the best way to share business-critical information such as OTP messages, appointment reminders, credit/debit messages, etc. However, it becomes difficult for your customers to trust the messages’ credibility unless they know it is from a verified account. With Verified SMS from Kaleyra, you can ensure a safer messaging experience and build a relationship of trust with the customer.

You can send vSMS in a few simple steps using our REST API.

Refer to our verified SMS blog for more information on the benefits of vSMS.

📘

Note:

The vSMS function should be supported on the mobile device to receive the verified SMS. If not, the messages will be delivered to the device as a standard SMS. vSMS works only on the Android messages app, and not on iOS devices. Only smartphone users with Android OS version 5.0 (Lollipop) and above can activate vSMS.

Prerequisites

  • Verify your business account and SenderID with Google to activate the vSMS
  • Provide the details such as brand name, company website, contact name, agent name, logo URL, sender ID, etc., for our team to get your details verified with Google.
  • SMS traffic and operations like campaign creation will not be affected during this process of activation.
  • Once your account and sender ID has been verified, then the vSMS feature will be activated.

Base URL

"https://api.kaleyra.io/v1/"

To send Verified SMS, follow the below steps:

1. Signup or Login to Kaleyra.io and create your API key.

Refer to Create an API Key page for steps to create your API key.

📘

Note:

After you sign up, your account will be on the trial version. You must complete the KYC to access all the features in Kaleyra.io.

2. API command to Send Verified SMS

Request Format

To send Verified SMS, use the /messages endpoints.

curl -X POST "https://<DOMAIN>/v1/<SID>/messages" \
     -H "api-key: <API_KEY>" \
     -d "to=<TO_NUMBER>" \
     -d "type=OTP|TXN" \
     -d "from=<SENDER_ID>" \
     -d "body=your OTP is 1234"
     -d "channel=vsms"
     -d "prefix=+91"
     -d "source=API"

📘

Note:

  • Ensure to replace the parameter values with the proper inputs in the above code.

Parameters and Variables

Below is the list of parameters and variables used:

Parameter

Variable

Description

Example

Mandatory

SID

String

Account SID (Security Identifier)

HXXXXXXX071US

Yes

API_KEY

String

API Key generated by Kaleyra.io

Ac4XXXXX21f

Yes

TO_NUMBER

Integer

Recipient's MSISDN

+1XXXXXXXXXX

Yes

TYPE

String

Type of route

OTP|TXN

Yes

BODY

String

Body content

your OTP is 1234

Yes

SENDER_ID

String

Originator/Alphanumeric ID

KLRHXA

Yes

CHANNEL

String

The channel on which message must be sent.

vsms

Yes

PREFIX

Integer

Specifies the country code.

+91

Yes, if the country code is not passed with "TO_NUMBER".

SOURCE

String

Specifies the request form.

API

No

3. Response Format

This section provides the success and failure JSON response format for different scenarios.

{
    "body": "Greetings Aman, Your OTP is 1234.",
    "sender": "KLRHXA",
    "type": "OTP",
    "id": "d707400d-504e-4ed9-ae58-3990fd0cef04",
    "createdDateTime": "2020-06-12 13:12:00+00:00",
    "totalCount": 1,
    "data": [
        {
            "message_id": "d707400d-504e-4ed9-ae58-3990fd0cef04:1",
            "recipient": "91xxxxxxxxxx"
        }
    ],
    "dlrurl": null,
    "error": {}
}

Sample Request

curl -X POST "https://<DOMAIN>/v1/HXXXXXXX071US/messages" \
     -H "api-key:Ac4XXXXX21f" \
     -d "to=+1XXXXXXXXXX" \
     -d "type=OTP|TXN" \
     -d "from=KLRHXA" \
     -d "body=your OTP is 1234"
     -d "channel=vsms"
     -d "prefix=+91"
     -d "source=API"

📘

Note:

In case of an error, ensure that the parameter values are correct in the above code. Refer to the Understand Error Codes page for detailed information.

The vSMS is sent to your customer, and below is the sample screen of the message received by them.


Did this page help you?