The SMS Works API
  1. messages
The SMS Works API
  • auth
    • /auth/getApiKey
      GET
    • /auth/token
      POST
  • batch messages
    • /batch/schedule
      POST
    • /batch/send
      POST
    • /batch/{batchid}
      GET
    • /batches/schedule/{batchid}
      DELETE
  • credits
    • /credits/balance
      GET
  • messages
    • /message/flash
      POST
    • /message/schedule
      POST
    • /message/send
      POST
    • /messages
      POST
    • /messages/failed
      POST
    • /messages/inbox
      POST
    • /messages/schedule/{messageid}
      DELETE
    • /messages/{messageid}
      DELETE
    • /messages/{messageid}
      GET
  • utils
    • /utils/errors/{errorcode}
      GET
    • /utils/test
      GET
  1. messages

/messages/inbox

POST
/messages/inbox
messages
Get unread uncoming messages matching your search criteria
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.thesmsworks.co.uk/v1/messages/inbox' \
--header 'Content-Type: application/json' \
--data-raw '{
    "credits": 2,
    "destination": "447777777777",
    "from": "Wed Jul 12 2017 20:26:28 GMT+0100 (BST)",
    "keyword": "SKYWALKER",
    "metadata": [
        {
            "key": "myKey1",
            "value": "myValue1"
        },
        {
            "key": "myKey2",
            "value": "myValue2"
        }
    ],
    "sender": "YourCompany",
    "status": "SENT",
    "to": "Wed Jul 19 2017 20:26:28 GMT+0100 (BST)",
    "unread": true
}'
Response Response Example
200 - Example 1
[
    {
        "batchid": "2586749",
        "content": "My super awesome message",
        "created": "Wed Jul 19 2017 20:53:46 GMT+0100 (BST)",
        "customerid": "0fca8c3c-6cbc-11e7-8154-a6006ad3dba0",
        "deliveryreporturl": "https://your.domain.com/delivery/report/path",
        "destination": "447777777777",
        "failurereason": {
            "code": 34,
            "details": "Handset error",
            "permanent": false
        },
        "id": 123456789,
        "identifier": 7777777777,
        "keyword": "CALRISSIAN",
        "messageid": 123456789,
        "modified": "Wed Jul 19 2017 20:53:49 GMT+0100 (BST)",
        "schedule": "Wed Jul 19 2017 20:53:45 GMT+0100 (BST)",
        "sender": "YourCompany",
        "status": "DELIVERED",
        "tag": "campaign2"
    }
]

Request

Body Params application/json
search parameters for querying the message database
credits
number 
optional
The number of credits used on the message. Floating point number.
Example:
2
destination
string 
optional
The phone number of the recipient. Start UK numbers with 44 and drop the leading 0.
Example:
447777777777
from
string 
optional
The date-time from which you would like matching messages
Example:
Wed Jul 12 2017 20:26:28 GMT+0100 (BST)
keyword
string 
optional
The keyword used in the inbound message
Example:
SKYWALKER
metadata
array [object] 
optional
An array of objects containing metadata key/value pairs that have been saved on messages.
Example:
[{"key":"myKey1","value":"myValue1"},{"key":"myKey2","value":"myValue2"}]
sender
string 
optional
The sender of the message (this can be the configured sender name for an outbound message or the senders phone number for an inbound message).
Example:
YourCompany
status
string 
optional
The status of the messages you would like returned (either 'SENT', 'DELIVERED', 'EXPIRED', 'UNDELIVERABLE', 'REJECTED' or 'INCOMING')
Example:
SENT
to
string 
optional
The date-time to which you would like matching messages
Example:
Wed Jul 19 2017 20:26:28 GMT+0100 (BST)
unread
boolean 
optional
In queries for incoming messages ('status' is 'INCOMING'), specify whether you explicitly want unread messages (true) or read messages (false). Omit this parameter in other circumstances.
Examples

Responses

🟢200Success
application/json
Body
array of:
batchid
string 
optional
Example:
2586749
content
string 
required
Example:
My super awesome message
created
string 
required
Example:
Wed Jul 19 2017 20:53:46 GMT+0100 (BST)
customerid
string 
required
Example:
0fca8c3c-6cbc-11e7-8154-a6006ad3dba0
deliveryreporturl
string 
optional
Example:
https://your.domain.com/delivery/report/path
destination
number 
required
Example:
447777777777
failurereason
object 
optional
code
number 
optional
Numeric code that defines the error. Integer.
Example:
34
details
string 
optional
Example:
Handset error
permanent
boolean 
optional
Example:
false
id
string 
optional
Example:
123456789
identifier
string 
optional
Example:
7777777777
keyword
string 
optional
Example:
CALRISSIAN
messageid
string 
required
Example:
123456789
modified
string 
required
Example:
Wed Jul 19 2017 20:53:49 GMT+0100 (BST)
schedule
string 
required
Example:
Wed Jul 19 2017 20:53:45 GMT+0100 (BST)
sender
string 
required
Example:
YourCompany
status
string 
required
Example:
DELIVERED
tag
string 
required
Example:
campaign2
🔴500Error
Modified at 2022-09-11 19:34:57
Previous
/messages/failed
Next
/messages/schedule/{messageid}
Built with