A plain REST API for відправлення SMS
POST your sender, recipient and content with a Token header. Get a message ID straight back, and delivery reports pushed to your server.
One request, one message
Authenticate with your access key, POST the message, and read the msgid from the response. Press the button to see it run.
1curl -X POST https://secure.smslocal.com/api/service/enterprise-service/external/sms \
2 -H "Token: $SMSLOCAL_TOKEN" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "from": "SMSLOCAL",
6 "to": "14155550123",
7 "content": "Your code is 481920."
8 }'
/external/smsRun the request to see the response.
Nothing exotic to learn
Three ideas cover the whole API, which follows plain REST conventions.
- Authentication
Token authentication
Send your access key in a Token header on every request, with JSON in and JSON out.
- No SDK required
- Works from any language
- Keep the key in an environment variable
- Відповідь
Know it was accepted
Every send returns a msgid and an errorcode immediately.
- Store the msgid against your own record
- errorcode 0 means accepted
- Use the msgid to match reports later
- Replies
Two-way by default
Replies arrive on the same callback, marked as mobile originated.
- Same message shape as reports
- Tell directions apart with mt / mo
- Route replies to your support tools
See what happened to every message
A status report is posted to your callback URL when a message reaches its final state.
- 1Match by msgidEvery report carries the ID you were given at send time.
- 2Final states onlyYou hear about a message when it is delivered or has failed.
- 3One callback URLThe same endpoint receives reports and replies.
9f2a7c10+1 415 ••• 0123Доставленоjust now9f2a7c11+91 98••• 43210Доставлено3 s ago9f2a7c12+44 7••• 123456В очікуванні5 s ago9f2a7c13+91 99••• 00012Failed9 s ago
See how a message is counted
Longer text and non-Latin characters change how many parts a message is billed as. Try your own wording, and look up a number before you send.
- частина 146 / 160
Одна частина містить 160 символів у GSM7 або 70 у Unicode. Один не-GSM-символ, як-от емодзі чи літера хінді, переводить усе повідомлення в Unicode.
Припиніть склеювати повідомлення вручну
Перетягніть роздільник, щоб порівняти.
- Повідомлення, надіслані з вашого власного коду
- Звіт про кожне повідомлення
- Відповіді надіслано до вашої системи
- Експорт і завантаження вручну
- Не знаю, чи надійшло повідомлення
- Відповіді потрапляють до чиєїсь папки "Вхідні".
Короткий контрольний список перед запуском
Відзначайте пункти по ходу. Тут нічого не збережено.
SMS API — запитання й відповіді
Передайте свій ключ доступу в заголовку Token кожного запиту разом із Content-Type: application/json.
Кожне надсилання повертає msgid. Направте нам URL-адресу зворотного виклику, і ми опублікуємо звіт про стан, коли повідомлення досягне остаточного стану.
160 символів у кодуванні GSM7 або 70 у кодуванні Unicode. Довші повідомлення об'єднуються з кількох частин, кожна з яких оплачується окремо.
так Вхідні відповіді доставляються на ту саму URL-адресу зворотного виклику та позначаються як надіслані з мобільного пристрою.
так SMS на індійські номери має використовувати схвалену організацію, заголовок відправника та шаблон. Наша команда допоможе вам зареєструвати їх під час реєстрації.
Надішліть своє перше SMS за лічені хвилини
Створіть обліковий запис, візьміть ключ доступу та зробіть перший запит.