This request will return a list of all the SMS/MMS messages sent by a customer.
The result set will always be reversed sorted (the newest messages first).
| URL | https://api.telecomx.dk/sms | |
|---|---|---|
| Method | GET | |
| Access level | VIEWER or MANAGER (cannot see content of messages), OWNER. RESELLER - can only see content of own messages. ADMIN. |
|
| Query | offset | [optional] Index of first message to return, default 0. |
| limit | [optional] Number of messages to return, default 100, max 1000. |
|
| customer | Id of customer the messages belongs to (RESELLER or ADMIN), auto-set for VIEWER, MANAGER and OWNER. | |
| to | [optional] Number the messages was sent to, E.164 format. |
|
| from | [optional] Number the messages was sent to, E.164 format. Or string if name was set as sender |
|
| message | [optional] Filters list by message |
|
| fromDate | [optional] From date in YYYY-MM format. |
|
| toDate | [optional] From date in YYYY-MM format |
|
| sort | [optional] Sorts the list, SENT, INVOICED and CREATED, if not set it will default to CREATED |
|
| names | [optional] Boolean if true response will contain variables fromName, toName and groupName |
|
https://api.telecomx.dk/sms https://api.telecomx.dk/sms?customer=123457890ABCDEF12345678 https://api.telecomx.dk/sms?customer=123457890ABCDEF12345678&to=+4581808888 https://api.telecomx.dk/sms?offset=100&limit=100&sort=SENT
| JSON object | ||
|---|---|---|
| offset | Integer | Index of first message returned. |
| limit | Integer | Number of messages to return, actual count may be lower. |
| total | Integer | Total number of messages in result set. |
| messages | Array | Array of SMS/MMS messages, see below. |
| SMS/MMS message (JSON object) | ||
|---|---|---|
| _id | Id | Id |
| customer | Id | Id of customer. |
| type | String | Type of message: 'SMS' or 'MMS'. |
| message | String | The SMS message (max. 1Kb) or the MMS raw data (max. 512Kb). |
| from | String | Sender name or number (max 11 chars). |
| to | Array | List of phone numbers of the recipients, E.164 format |
| sent | Date | The date and time the message was sent, null if not yet sent. |
| cost | Integer | Price for admin (ADMIN only) |
| wholeSale | Integer | Price for reseller (RESELLER or ADMIN only) |
| price | Integer | Price for customer |
| toName | String | Name of sender |
| fromName | Array | Name of recivier |
| groupName | String | If sms is send to group then the name of the group |
Note that properties holding no value may be omitted.
{ offset: 0, limit: 100, total: 10000, messages: [ { _id: '123457890ABCDEF12345678', customer: '123457890ABCDEF12345678', type: 'SMS', message: 'This is a test', from: 'Voicemail', to: ['+4581808888'], sent: '2014-01-01T12:34:56.789Z', fromName: "Anders And", toName: ["Rip"], cost: 0.5, price: 0.75, wholeSale: 0.65 }, { ... } ] }
| Error code | Message | Description |
|---|---|---|
| 404 | bad_request | Customer not found |
| 403 | access_denied | Insufficient access level |
| 500 | internal_error | <Unspecified> |