Messages

Message endpoints are meant to send and monitor messages sent by the account. Message is a single one to one conversation entity.

A single SMS can contain 160 characters. If the message contains any characters not listed in the 7-bit alphabet, then the message encoding will be set to UCS-2. The message length is limited to 70 characters. Additionally, for long SMS messages exceeding above-mentioned limits, will be supported by splitting them into multiple segments. For WhatsApp and Viber messages the maximum limit of characters is 1024 and 1000 for any character set correspondingly.

Method: Create

Operation sends a message from a sender to one or many recipients.

URL /v1/messages
Method Type POST
Authorization API Key
Request Content-Type JSON
Response Content-Type JSON

Headers

Name Type Description Status
X-Dexatel-Key string API key Required

Request Body

Name Type Description Status
data object

Details

(see data object below)
Optional
data object
Name Type Description Status
from string Identifier of the sender Required
to array List of recipients who will receive the message Required
text string Body of the message Optional
channel string Delivery channel of the massage. Possible values:
SMS
VIBER
WHATSAPP
Required
image string URL of the image to be sent in the massage Optional
caption string Caption for image Optional
template string Identifier of the template O Optional
variables array List of the template values Optional
schedule string Optional
button object

Details

(see button object below)
Optional
button object
Name Type Description Status
caption string caption description Optional
url string example description Optional

Response Parameters

Name Type Description Status
data array

Details

(see data object below)
Optional
data object
Name Type Description Status
id string Unique identifier of the object Optional
account_id string Unique identifier of the account Optional
text string Body of the message Optional
from string Identifier of the sender Optional
to string List of recipients who will receive the message, can be up to 10 recipients. Optional
channel string Delivery channel of the massage. Possible values:
SMS
VIBER
WHATSAPP
Optional
status string Initial status of the message Optional
segments integer The count of sent messages Optional
encoding string Encoding of the message. Possible values:
• GSM -7
• UCS -2
Optional

Example of request body

POST: /v1/messages
X-Dexatel-Key: 94d2f2f2884848bca861264ad86d8ace
Content-Type: application/json

                
                        

Example of response body

status - 201

                
                        

Error Codes

The following error codes are returned in response to a user’s request which contains bad syntax or cannot be fulfilled.

Code Description
1501 Message is not found
1502 Invalid message identifier
1503 'data.from' is required
1504 'data.from' is invalid
1505 Message sender is not found
1506 'data.to' is required
1507 'data.to' must be at most [10] items in length
1508 'data.text' is required
1509 'data.text' is invalid
1510 'data.text' is too long
1512 'data.template' is invalid
1513 Template is not found
1514 'data.variables' is required
1515 'data.channel' should be in: [SMS, WHATSAPP, VIBER]
1516 One of text, image or template should be specified
1517 Button messages are not supported for whatsapp channel
1518 Image messages are not supported for sms channel
1519 Button messages are not supported for sms channel
1520 'data.button' is required
1521 'data.schedule' is invalid
1522 'data.schedule' should be after current date
1523 Invalid recipient number(s)