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

/message/flash

POST
/message/flash
messages
Sends an SMS flash message, which appears on the recipients lock screen
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.thesmsworks.co.uk/v1/message/flash' \
--header 'Content-Type: application/json' \
--data-raw '{
    "content": "Your super awesome message",
    "deliveryreporturl": "http://your.domain.com/delivery/report/path",
    "destination": "447777777777",
    "metadata": [
        {
            "key": "myKey1",
            "value": "myValue1"
        },
        {
            "key": "myKey2",
            "value": "myValue2"
        }
    ],
    "responseemail": [
        "my.email@mycompany.co.uk",
        "my.other.email@mycompany.co.uk"
    ],
    "schedule": "Sun Sep 03 2020 15:34:23 GMT+0100 (BST)",
    "sender": "YourCompany",
    "tag": "SummerSpecial",
    "ttl": 10
}'
Response Response Example
200 - Example 1
{
    "message": "string",
    "errorCode": 0,
    "permanent": true,
    "status": "string"
}

Request

Body Params application/json
SMS message object
content
string 
required
Message to send to the recipient. Content can be up to 1280 characters in length. Messages of 160 characters or fewer are charged 1 credit. If your message is longer than 160 characters then it will be broken down in to chunks of 153 characters before being sent to the recipient's handset, and you will be charged 1 credit for each 153 characters. Messages sent to numbers registered outside the UK will be typically charged double credits, but for certain countries may be charged fractions of credits (e.g. 2.5). Please contact us for rates for each country.
Example:
Your super awesome message
deliveryreporturl
string 
optional
The url to which we should POST delivery reports to for this message. If none is specified, we'll use the global delivery report URL that you've configured on your account page.
Example:
http://your.domain.com/delivery/report/path
destination
string 
required
Telephone number of the recipient
Example:
447777777777
metadata
array [object] 
optional
Example:
[{"key":"myKey1","value":"myValue1"},{"key":"myKey2","value":"myValue2"}]
responseemail
array[string]
optional
An optional list of email addresses to forward responses to this specific message to. An SMS Works Reply Number is required to use this feature.
Example:
["my.email@mycompany.co.uk","my.other.email@mycompany.co.uk"]
schedule
string 
optional
Date at which to send the message. This is only used by the message/schedule service and can be left empty for other services.
Example:
Sun Sep 03 2020 15:34:23 GMT+0100 (BST)
sender
string 
required
The sender of the message. Should be no longer than 11 characters for alphanumeric or 15 characters for numeric sender ID's. No spaces or special characters.
Example:
YourCompany
tag
string 
optional
An identifying label for the message, which you can use to filter and report on messages you've sent later. Ideal for campaigns. A maximum of 280 characters.
Example:
SummerSpecial
ttl
number 
optional
The optional number of minutes before the message is deleted. Optional. Omit to prevent delivery report deletion. Integer.
Example:
10
Examples

Responses

🟢200Error
application/json
Body
message
string 
required
errorCode
number 
required
Numeric code used to identify the error. Integer.
permanent
boolean 
optional
status
string 
required
🟢201Success
🟠402Error
Modified at 2022-09-11 19:34:57
Previous
/credits/balance
Next
/message/schedule
Built with