Powerful Developer SMS API
Integrate SMS Communications in to anything and everything. Your own projects, or for your clients.
~40ms API completion time, up to 15,000 SMS in a single API call
HTTPS/REST with OpenAPI Specification
Single SMS, Bulk SMS, Replies, Delivery Receipts, Contact Management
OAuth for multiple clients or simple API Key
We use OpenAPI (or Swagger) to make sure that we're as consumable as possible.
View OpenAPI DocumentationSingle SMS
Low volume? No worries. You can send single SMSes, almost instantly.
Bulk SMS
Sending a tonne? Guess what, you can do that too, almost instantly.
Receive Replies
Want responses in your app? We got you. We'll POST them to you.
C# Example
Do you speak our native language? We have a NuGet package for you.
Install-Package Cedita.PureSms.Client
If you're using Dependency Injection, you can automatically add the client:
services.AddPureSms(m => m.ApiKey = "My API Key");
You can then use the client to send an SMS instantly.
using Cedita.PureSms.Client;
.. ISmsService smsService ..
var result = await smsService.SendSmsAsync(new OutboundSms {
From = "Somebody",
To = "4471234123123",
Content = "Hello this is my first SMS",
});
if (result.Succeeded) { .. }
else { .. }
PHP Example
If you need to integrate into Wordpress, or you're just a PHP dev, here's a quick example for you.
$apiKey = "My API Key";
$testMode = true;
$outboundSms = array(
'to' => '4471234123123',
'from' => 'Somebody',
'content' => 'Hello this is my first SMS'
);
$curl = curl_init('https://api.puresms.uk/v1/Sms/Send' . ($testMode ? '?isTest=true' : ''));
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($outboundSms));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'X-API-Key: ' . $apiKey,
'Content-Type: application/json'));
$result = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
if ($status == 200) {
echo 'The test was successful.';
}
else {
echo 'The test failed';
}
Delivery Receipts
For each individual message, or batch of them, you can set a Webhook for Delivery Receipts to be sent to.
Delivery of these webhooks will be a simple HTTP POST with a JSON body, following this format:
[
{
"reference": "ABC123",
"clientReference": "CLI-1",
"batchReference": "BATCH1",
"deliveryStatus": 2,
"additionalMessage": null
},
...
]
We need you to respond with a 200 OK, or we'll think we haven't reached you and will keep trying. We also batch up receipts, so you may get more than 1 back at any time.
reference is PureSMS' unique identifier for each message, where clientReference and batchReference are your own (where provided). additionalMessage is currently reserved.
Code | Status | Description |
---|---|---|
0 | Scheduled | The message is scheduled for later sending. |
1 | Enroute | The message is enroute. |
2 | Delivered | The message was successfully delivered. |
3 | Expired | The SMSC was unable to deliver the message in a specified amount of time. For instance, the phone may be turned off. |
4 | Deleted | The message was deleted. |
5 | Undeliverable | The SMSC was unable to deliver the message. For instance, the phone number may not exist. |
6 | Accepted | The SMSC accepted the message and it will be sent. |
7 | Unknown | Unknown error occurred. |
8 | Rejected | The message was rejected. The provider may have blocked phone numbers in this range. |
9 | Skipped | The message was skipped. |