Send verified SMS easily with Kaleyra Cloud API

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 Cloud 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 Cloud.

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

<TO_NUMBER>

Integer

Recipient's MSISDN

+1XXXXXXXXXX

Yes

<SENDER_ID>

String

Originator/Alphanumeric ID (default KLRHXA)

KLRHXA

Yes

<API_KEY>

String

API Key generated by Kaleyra Cloud

Ac4XXXXX21f

Yes

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.





ยฉ 2020-2021 Kaleyra Inc. All rights reserved

Trademarks, logos and service marks displayed on this site are registered and unregistered trademarks of Kaleyra Inc.

Updated 18 days ago



Send verified SMS easily with Kaleyra Cloud API


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.