Data Soap
> SMS API

SMS API

A JSON-based synchronous API designed for ease of use - send and receive SMS messages.

Back to API list
BASE · https://api.datasoap.co.uk

Introduction

Before integrating, please consider the following:

  • Treat your account details and credentials as confidential - you're responsible for every request submitted.
  • All submissions are audited for management and security purposes.
  • Duplicate submissions are charged individually.

Getting started

Set up an API token under Profile → API Authentication. Use the right token for your needs and never share a private token with an end user. If you don't have credits yet, buy them from your account or by calling 0207 856 0422.

Requests go to https://api.datasoap.co.uk over SSL (port 443), as JSON, with your token in the auth header:

Header
Authorization: Bearer f07772e880ae4789b5a964c91a151a...

Sending messages

POST/v1/sms/single

Queues a single message to be sent and returns an ID you can use to check deliverability later. You can only send from your approved SMS headers, and to numbers not in your associated unsubscribe group.

Request
{
"to": "07976123456",
"from": "DataSoap",
"message": "Hi John...... etc"
}
Response
{ "id": 1634215, "status": "Pending" }

Status is Pending or Failed on the initial request. If there's an error, it comes back in an errors field - see Errors below.

Checking status

GET/v1/sms/status/{id}

Get the current status of a message, to check its deliverability.

Response
{ "id": "1634215", "status": "Delivered" }
Status
Meaning
Pending
Queued for sending, not yet sent.
Sent
The message has been sent.
Delivered
The mobile network has marked the message as delivered.
Undeliverable
Couldn't deliver - a network fault, or the number may not be valid.

Sent messages

POST/v1/sms/sent

A paginated list of every message sent. All fields are optional filters - drop the ones you don't need.

Request
{
"pageSize": 10,
"pageNumber": 1,
"from": "No Reply",
"to": "07976123456",
"date": { "from": "2023-01-07T11:08:22.897Z", "to": "2024-12-07T11:08:22.897Z" }
}
Response
{
"data": [
{ "id": 1634215, "from": "DataSoap", "to": "+447976123456", "message": "Hi John...... etc", "sentOn": "2023-01-31T11:45:40.363" },
{ "id": 1634214, "from": "NoReply", "to": "+447976123456", "message": "Your 2FA code is 123456", "sentOn": "2023-01-31T11:45:40.363" }
]
}

Received messages

POST/v1/sms/received

A paginated list of every message received - you'll need to buy a number from your account before you can start receiving messages. All fields are optional filters.

Request
{
"pageSize": 10,
"pageNumber": 1,
"from": "07976123456",
"to": "079761210023",
"date": { "from": "2023-01-07T11:08:22.897Z", "to": "2024-12-07T11:08:22.897Z" }
}
Response
{
"data": [
{ "id": 634215, "from": "+447976123456", "to": "+4479761210023", "message": "Hi, can I get a call back?", "receivedOn": "2023-01-30T09:45:04.133" }
]
}

Errors

If an error occurs, the response contains an errors field with the relevant detail:

Error response
{
"errors": [
{ "code": "-110", "message": "Invalid format, check your model is valid and numbers are in E164 format", "temporary": false }
]
}
Code
Type
Description
-101
N/A
Invalid format - check your model is valid and numbers are in E.164 format.
-111
N/A
An approved originator (sender ID) must be selected - check your account or contact support.
-112
N/A
The destination country/network is inside a restricted range - contact support.
-113
N/A
The SMS ID is not valid for this account.
-114
N/A
Unable to send - the number is on the unsubscribe list associated with this originator.

Trusted at scale

The same infrastructure behind every endpoint on this page, in production today.

0B+
Numbers validated
0K+
Batch cleans
0ms
p50 latency
0%
Uptime