Kaleyra Cloud API Documentation

Send Your First SMS

POST Method

Description

SMS is a simple and cost-effective way to communicate with customers. By now, you would have configured the SMS channel in the KCloud. Now, let's use this API to send your first outbound SMS.

Send an SMS

1. Signup or Login to KCloud and create your API key.

Refer to the 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 KCloud.

2. Send the SMS

Execute the following API command to send your first outbound SMS.

curl -X POST "https://api.kaleyra.io/v1/<SID>/messages" \
     -H "api-key: <API_KEY>" \
     -d "to=<TO_NUMBER>" \
     -d "sender=<SENDER_ID>" \
     -d "body=Hello! This is my first SMS."

Ensure to replace the parameter values with the proper inputs in the above code. The below table has a list of parameters and their information.

Replace

With

Example

Mandatory

<SID>

Account SID (Security Identifier)

HXXXXXXX071US

True

<TO_NUMBER>

Recipient's MSISDN

+1XXXXXXXXXX

True

<SENDER_ID>

Originator/Alphanumeric ID (default KLRHXA)

KLRHXA

True

<API_KEY>

API Key generated by Kaleyra Cloud

Ac4XXXXX21f

True

3. Below is the response sample.

{
  "id": "ee8aXXXX-XXXX-XXXX-XXXX-9b717XXXX30d",
  "sender": "KLRHXA",
  "type": "DEFAULT",
  "body": "Hello! This is my first SMS.",
  "createdDateTime": "2019-11-04 10:42:23+00:00",
  "totalCount": 1,
  "data": [
    {
      "message_id": "ee8aXXXX-XXXX-XXXX-XXXX-9b717XXXX30d:1",
      "recipient": "1XXXXXXXXXX"
    }
  ],
  "dlrurl": null,
  "error": {}
}

📘

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.

Updated 8 days ago



Send Your First SMS


POST Method

Suggested Edits are limited on API Reference Pages

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