Para sa developer
SMS gateway API Bulk SMS at OTP SMS sa REST
Ikonekta ang iyong app, online store o booking system sa WorldText SMS gateway. Pareho ang presyo at patakaran sa pagpapadala sa web console.
20,000Max na numero kada request
120Request kada minuto kada key
JSONRequest at response
Mabilis na simula
Unang request
- 01Pumunta sa pahina ng API sa iyong account at gumawa ng key. Nagsisimula ang mga key sa wt_.
- 02Idagdag ang header na Authorization: Bearer <key> sa bawat request.
- 03Kumuha ng presyo gamit ang POST /api/v1/quote, saka magpadala sa POST /api/v1/messages.
Base URL
https://worldtext.world/api/v1
Endpoint
Listahan ng endpoint
| Method at path | Gamit |
|---|---|
GET /api/v1/balance | Ang kasalukuyan mong balance, sa USD |
GET /api/v1/countries | Mga sakop na bansa at presyo kada SMS (gumagana kahit walang key) |
POST /api/v1/quote | Presyo, bilang ng part at mga inalis na numero, nang hindi nagpapadala |
POST /api/v1/messages | Ipadala ngayon, o mamaya kapag may schedule_at |
GET /api/v1/messages | Listahan ng mga kamakailang padala (limit, offset) |
GET /api/v1/messages/{id} | Isang padala at ang resulta nito bawat bansa |
POST /api/v1/messages/{id}/cancel | Kinakansela ang naka-schedule na padalang hindi pa naipapadala at buong ire-refund |
Pagpapadala
Pagpapadala ng mensahe
Ipasa ang to field bilang array ng mga numero, o bilang text na may isang numero kada linya. Para sa mga numerong walang +, itakda ang country field sa two-letter na country code, tulad ng ph o us.
| Field | Detalye |
|---|---|
to | Ang tatanggap. Array, o isang numero kada linya, hanggang 20,000 |
text | Laman ng mensahe, hindi lalampas sa 10 part |
country | Opsyonal. Two-letter na country code para sa mga numerong walang + |
schedule_at | Opsyonal. ISO timestamp na may time zone (tulad ng 2026-12-01T09:00:00Z) o Unix seconds, mula 5 minuto hanggang 30 araw mula ngayon |
client_ref | Opsyonal. Sarili mong reference, hanggang 64 character |
Response · 201201 Created
{
"ok": true,
"campaign": {
"id": "K7Q2M9XD4TPA",
"status": "sending",
"recipients": 2,
"parts": 1,
"encoding": "GSM-7",
"cost": "0.0105",
"countries": [
{ "country": "US", "recipients": 1, "cost": "0.0041" },
{ "country": "GB", "recipients": 1, "cost": "0.0064" }
]
},
"rejected": [],
"duplicates": 0,
"opted_out": 0,
"balance": "48.9895"
}POST /api/v1/messages
curl -X POST https://worldtext.world/api/v1/messages \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": ["+14155550142", "+447400123456"],
"text": "Your order #A2847 has shipped."
}'POST /api/v1/quote
curl -X POST https://worldtext.world/api/v1/quote \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "to": ["+14155550142", "+819012345678"], "text": "Hello" }'Response · 200200 OK
{
"ok": true,
"recipients": 2,
"parts": 1,
"encoding": "GSM-7",
"cost": "0.0131",
"balance": "49.00",
"countries": [
{ "country": "JP", "recipients": 1, "price": "0.009", "cost": "0.009" },
{ "country": "US", "recipients": 1, "price": "0.0041", "cost": "0.0041" }
],
"rejected": [],
"duplicates": 0,
"opted_out": 0
}Error
Mga error response
| Code | HTTP | Dahilan |
|---|---|---|
unauthorized | 401 | Walang key, o invalid ang key |
rate_limited | 429 | Masyadong maraming request ngayong minuto |
bad_request | 400 | Hindi mabasa ang request body |
empty_text | 400 | Walang text ang mensahe |
too_long | 400 | Lampas sa 10 part ang text |
no_numbers | 400 | Wala ni isang numerong mapapadalhan |
too_many | 400 | Higit sa 20,000 numero sa isang request |
bad_time | 400 | Nasa labas ng pinapayagang oras ang schedule_at |
low_balance | 402 | Kulang ang balance para sa padalang ito |
unavailable | 503 | Naka-pause ang pagpapadala sa ngayon, at walang credit na kinuha |
not_found | 404 | Walang ganoong send ID |
not_scheduled | 409 | Naipadala na o nakansela na ang padala |
Mga limit
- Hanggang 120 request kada minuto ang bawat key.
- Bumabalik ang mga halaga ng pera bilang USD string, halimbawa "0.0047".
- Ang send ID ay random na 12-character na code, hindi sunod-sunod na numero.
- Pareho sa web console ang pag-filter ng numero at ang opt-out list.