SENDO SMS API
SENDO SMS message sending API to integrate your events requested by backend flows, client-side applications or scheduled automations. Send SMS messages to a client or several clients in the same request, define a callback URL to receive the status of each event.
SMS
Send SMS
This endpoint is used to send messages to a unique destination.
Body attributes
| Field | Type | Description | Default Value | Optional | Comments |
|---|---|---|---|---|---|
| appOrigin | string | Origin from where request is send | none | No | |
| campaign_external_id | string | External ID of the campaign | none | Yes | |
| url | string | url for use in the message | none | Yes | To include a url in a message, it must be sent as a variable, for example: Hello {{url}}. |
| senderId | string | Short code to use | none | No | |
| destination | string | Number to send the message. See Destination Definition | none | No | |
| coding | int | Message codification to use. See Coding Definition | 0 | Yes | |
| content | string | Message content (max. 500 characters) | none | No | |
| priority | int | Message priority (a higher value indicates a higher priority) See Priority Definition | none | Yes | |
| validityPeriod | int | Valid period in hours for receiving DLR | none | No | |
| obfuscated | boolean | Determine whether or not to encrypt the message | false | Yes | |
| dlr | boolean | Determines whether or not to receive DLR | false | Yes | |
| dlrWebhook | string | URL of webhook to send DLR event | none | No | Only required if dlr is enabled |
| dlrMethod | string | Method of webhook to send DLR event | none | No | - Only required if dlr is enabled - Only POST method allowed |
NOTE: The URL you enter in the body of the request will be shortened to the following format: s3n.me/v4cv0. NOTE: When using url variable, the field url must be sent to prevent unreadable content.
Request body.
curl -X 'POST'
'http://35.185.103.32:3000/api/sms/send'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{"appOrigin": "https://my.domain.com or My APP","campaign_external_id": "TEST","senderId": "3636","destination": "9999999","coding": 0,"content": "Hello world","priority": 0,"validityPeriod": 0,"obfuscated": false,"dlr": false,"dlrWebhook": "https://my.domain.com/receive","dlrMethod": "POST"}'
| Code | Description |
|---|---|
| 200 | Successful |
{
"message_id": "8fe793e2-3a5e-452e-a92a-363666248098"
}
Server responses.
Send SMS Batch
This endpoint is used to send low priority messages to a more than one destination.
Required attributes
| Field | Type | Description |
|---|---|---|
| File | .json | File to upload, format must be JSON |
File format
{"appOrigin": "YOURBRAND-APP","senderId": "CL 3333 MV 3636","destinations": [593919191919],"coding": 0,"content": "Lorem ipsum dolor sit amet,","validityPeriod": 2,"dlr": false,"obfuscated": true,"callback_url": "https://fine-gray-seal-hose.cyclic.app/response"}
Request body.
curl -X 'POST' 'http://35.185.103.32:3000/api/sms/send-batch' -H 'accept: application/json' -H 'Content-Type: multipart/form-data' -F 'file=@fileName.json;type=application/json'
Responses.
{
"bulkId": "8fe793e2-3a5e-452e-a92a-363666248098"
}
Server responses.
Webhook
Callback response
Method POST
To receive the ids of the messages generated by the transaction in the request, set the callback_url field with a valid URL Send SMS Batch API
The id format is generated using the UUID v4 standard.
Callback Response
"Messages"
{
"status": string,
"bulk_id": string,
"messages": [Array]
}
Example Response
"Messages"
{
"status": "success",
"bulk_id": "eacb2a06-b218-4503-855e-1f0f6202bd07",
"messages": [
{
"destination": "593919191919",
"id": "d1989cc0-9fdc-4f0d-81b4-7e4ab147ed0b"
},
{
"destination": "593698636989",
"id": "17bc3fb3-8404-4736-b599-83d80d6bf47c"
},
{
"destination": "777777",
"id": null,
"error": "777777 is not a valid phone number"
}
]
}
The webhook expects an HTTP response with a 200 response code with no body.
DLR response
To receive a final message status update, set the property dlr, dlrWebhook and dlrMethod in Send SMS API or Send SMS Batch API
DLR Response
"MessageBatchHook"
{
"status": string,
"bulk_id": string,
"message_id": string
}
Example Response
"MessageBatchHook"
{
"status": "success",
"bulk_id": "0d284743-99e9-43af-b24d-dbea8ee82541",
"message_id": "d3a90127-c26e-4238-a8fc-3d130a557493"
}
The webhook expects an HTTP code response which might be:
| Code | Description |
|---|---|
| 200 | Success with return data |
| 201 | Success with no return data |
| 204 | Success with no return data |
The SMPP protocol supports delivery of reports (DLR) to determine the result of the message sent. Each error code returned will indicate the status at the time of attempting to deliver the message, and are associated with both the SMS Gateway and the SMSC platform. See more.
MO forwarding
If you want to receive MO from your customers, you can send a request to the following endpoint:
Required attributes
| Field | Type | Description | Example |
|---|---|---|---|
| mo_url | string | URL to forward MO | https://YOUR_DOMAIN/MO_API |
| Code | Description |
|---|---|
| 200 | OK |
MO Structure
The following structure will be send to the url gived in mo_url.
{
short_code: "001"
from: "593999999999"
message: "Hello World"
application_id: 0
}
The endpoint provided must return a 200 status code to confirm the reception of the MO.
Definitions
Coding
When sending messages, it is important to consider the encoding of data for both receiving and sending. Standard encoding values are listed below.
| Coding | Sender ID | Character Set | Bits per Character | Characters per Single Message | Max per Concat. Part |
|---|---|---|---|---|---|
| 0 Default | Short Code long Code | ASCII | 7 | 160* | 153 |
| 0 Default | 8XX (Toll-Free) | GSM | 7 | 160* | 153 |
| 1 | Short Code long Code | ASCII | 8** | 140** | 136** |
| 1 | 8XX (Toll-Free) | Latin-9 | 8 | 140 | 134 |
| 3 | All | latin-1 | 8 | 140 | 134 |
| 8 | All | UTF-16 | 16 | 70 | 67 |
Priority
| Priority | Description | Value to use |
|---|---|---|
| Level 0 | Lowest priority. This value is recommended to set to the bulk process. | 0 |
| Level 1 | This value must be set to the OTP flow | 1 |
| Level 2 | Intermediate priority | 2 |
| Level 3 | High priority | 3 |
Destination
Destinations numbers are formatted following pattern:
[country code] [subscriber number including area code]
Maximum length: 15 digits.
Example: 593123456789, 505123456789