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: Query
Operation to query all messages.
URL | /v1/messages |
Method Type | GET |
Authorization | API Key |
Request Content-Type | JSON |
Response Content-Type | JSON |
Headers
Name | Type | Description | Status |
---|---|---|---|
X-Dexatel-Key | string | API key | Required |
Query parameters
Name | Type | Description | Status |
---|---|---|---|
page_token | string | token with encoded pagination details | Optional |
page_size | string | number of records to be retrieved | Optional |
filter[countries] | string | Shows messages for the specified countries | Optional |
filter[sender_ids] | string | Shows messages for the specified sender IDs | Optional |
filter[created_date_start] | string | Shows messages created from the specified date and time | Optional |
filter[created_date_end] | string | Shows messages created to the specified date and time | Optional |
filter[direction] | string | Shows sent or received messages. Possible values MT and MO .(MT: Message is sent to mobile number, MO: messages is received from mobile number) | Optional |
filter[statuses] | string | Shows messages for the specified statuses. Possible values FAILD, SENT, DELIVERED and SEEN | Optional |
filter[to] | string | Shows messages for the specified recipient number | Optional |
filter[from] | string | Shows messages for the specified sender | Optional |
filter[to_prefix] | string | Shows messages for the specified prefixes | Optional |
filter[channel] | string | Shows messages for the specified Channel. Possible values: SMS, VIBER, WHATSAPP | Optional |
Request Body
-empty-Response Parameters
Name | Type | Description |
---|---|---|
data | array |
Details (see data object below) |
pagination | object |
Details (see pagination object below) |
Name | Type | Description |
---|---|---|
id | string | Unique identifier of the message |
account_id | string | Unique identifier of the account |
from | string | Identifier of the sender |
to | string | List of recipients who will receive the message |
channel | string |
Delivery channel of the massage. Possible values: •SMS •VIBER |
status | string |
Delivery status of the message. Possible values: • scheduled • enroute • sent • received • delivered • failed |
text | string | Body of the message |
image | string | |
caption | string | |
button | object |
Details (see button object below) |
schedule | string | |
template_id | string | |
create_date | string | Creation date of the message in UTC, formatted as yyyyMM-dd HH:mm:ss |
update_date | string | Update date of the message in UTC, formatted as yyyy-MM-dd HH:mm:ss |
segments_count | integer | The count of message parts |
encoding | string |
Encoding of the message. Possible values: • GSM-7 • UCS-2 |
sender | object |
Details (see sender object below) |
direction | string | |
source | string | |
country | string |
Name | Type | Description |
---|---|---|
caption | string | caption description |
url | string | example description |
Name | Type | Description |
---|---|---|
id | string | |
name | string |
Name | Type | Description |
---|---|---|
number | integer | Number of current page |
size | integer | Items count in page |
total | integer | Total count of items |
links | object |
Details (see links object below) |
Name | Type | Description |
---|---|---|
first | string | |
current | string | |
previous | string | |
next | string |
Example of request body
Example of response body
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 |
1523 | Invalid recipient number(s) |