Textblaster SMS API
Use https://www.textblaster.co.uk/api or the branded API domain shown in your dashboard. Create a key with the permissions your application needs.
Send a transactional SMS
curl https://www.textblaster.co.uk/api/v1/messages \
-H "Authorization: Bearer $TEXTBLASTER_KEY" \
-H "Idempotency-Key: order-8841-shipped" \
-H "Content-Type: application/json" \
-d '{"to":"+447700900142","from":"Juniper","body":"Your order has shipped."}'
const response = await fetch(
'https://www.textblaster.co.uk/api/v1/messages',
{
method: 'POST',
headers: {
'Authorization': 'Bearer ' + process.env.TEXTBLASTER_KEY,
'Idempotency-Key': 'order-8841-shipped',
'Content-Type': 'application/json'
},
body: JSON.stringify({
to: '+447700900142', from: 'Juniper', body: 'Your order has shipped.'
})
}
);
console.log(await response.json());
import json
import os
from urllib.request import Request, urlopen
url = 'https://www.textblaster.co.uk/api/v1/messages'
data = {'to': '+447700900142', 'from': 'Juniper', 'body': 'Your order has shipped.'}
request = Request(url, data=json.dumps(data).encode(), headers={
'Authorization': 'Bearer ' + os.environ['TEXTBLASTER_KEY'],
'Idempotency-Key': 'order-8841-shipped',
'Content-Type': 'application/json'
})
with urlopen(request) as response:
print(json.load(response))
The API queues the message and returns 202, a message ID and the number of segments reserved. Use an approved sender for live traffic. Sandbox sends return sandbox: true and never contact a carrier.
Retry with the same idempotency key and the same payload. Reusing a key with changed data returns 409. Delivery states include queued, submitting, accepted, delivered, undelivered, failed and unknown. An unknown delivery is held for review.
Endpoints and scopes
GET /api/v1/balancecredits:readPOST /api/v1/messagesmessages:sendGET /api/v1/messages/{id}messages:readGET /api/v1/clientsclients:readPOST /api/v1/clientsclients:writePOST /api/v1/clients/{id}/creditscredits:allocateClient creation accepts name. Credit allocations accept credits, an external payment reference and an Idempotency-Key header. Only master reseller accounts can use these endpoints.