Send Flash SMS
POST Method
Description
This API allows you to send Flash SMS that gets displayed on the recipient's phone screen immediately. The Flash SMS does not get stored into the SMS inbox on the device automatically. This type of SMS can be used to deliver sensitive information.
Base URL
<https://api.kaleyra.io/v1/><SID>
To send Flash SMS, follow the below steps:
- Signup or Login to Kaleyra.io and create your API key.
Refer to the Create an API Key page for steps to create your API key. To view the API Key and the SID, see View API Key and SID.
- API command to Send Flash SMS
Request Format
To send Flash SMS, use the /messages endpoints.
curl -X POST "https://api.kaleyra.io/v1/<SID>/messages" \
-H "api-key: <API_KEY>" \
-d "to=<TO_NUMBER>" \
-d "type=<TYPE>" \
-d "sender=<SENDER_ID>" \
-d "body=<MESSAGE>" \
-d "flash=1"
Note:
- Ensure to replace the parameter values with the proper inputs in the above code.
- You can add multiple recipient in "to" value using comma (,) delimiter.
Parameters and Variables
Below is the list of parameters and variables used:
Parameter | Variable | Description | Example | Mandatory |
---|---|---|---|---|
SID | String | Account SID (Security Identifier) e.g. HXXXXXXX071US | HXXXXXXX071US | True |
API_KEY | String | API Key generated by Kaleyra.io | Ac4XXXXX21f | True |
TO_NUMBER | Integer | Recipient's MSISDN | +1XXXXXXXXXX,+1XXXXXXXXXX | True |
TYPE | String | Type of route | OTP/DEFAULT/MKT/TXN understand route types | False |
SENDER_ID | String | Originator/Alphanumeric ID | KLRHXA | True |
- Response Format
This section provides you the success and failure JSON response format for different scenarios.
Success Response
{
"id": "648xxx2c-xxxx-xxxx-80c5-3c2xxxb391",
"sender": "KLRHXA",
"type": "DEFAULT",
"flash": 1,
"body": "Hello Welcome!!",
"createdDateTime": "2019-11-04 10:42:23+00:00",
"totalCount": 1,
"data": [
{
"message_id": "648xxx2c-xxxx-xxxx-80c5-3c2xxxb391: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.
Sample Request
curl -X POST "https://api.kaleyra.io/v1/HXXXXXXX071US/messages" \
-H "api-key:Ac4XXXXX21f" \
-d "to=+1XXXXXXXXXX" \
-d "type=OTP/DEFAULT/MKT/TXN" \
-d "sender=KLRHXA" \
-d "body=Hello Welcome!!" \
-d "flash=1"
Updated 11 months ago