DEVELOPER API
SMS API Magpadala gamit ang isang key
Magpadala ng text mula sa app, online store o booking system mo gamit ang SMS API ng SMSWorld. Parehong presyo at patakaran gaya ng send screen sa web.
1,000Numero bawat request
120Request bawat minuto
JSONPasok at labas
QUICK START
Magsimula
- 01Gumawa ng key sa API page sa account mo (nagsisimula ito sa sw_).
- 02Ipadala ang header na Authorization: Bearer <key> sa bawat request.
- 03Tingnan ang gastos gamit ang POST /api/v1/quote, saka magpadala gamit ang POST /api/v1/messages.
Base URL
https://smsworld.shop/api/v1
ENDPOINTS
Mga endpoint
| Request | Ginagawa nito |
|---|---|
GET /api/v1/balance | Balance sa US dollar |
GET /api/v1/countries | Mga bansa at presyo bawat SMS (walang key na kailangan) |
POST /api/v1/quote | Gastos, bahagi at inalis na numero bago magpadala |
POST /api/v1/messages | Magpadala, o mag-schedule gamit ang schedule_at |
GET /api/v1/messages | Mga kamakailang padala (limit, offset) |
GET /api/v1/messages/{id} | Isang padala na may resulta bawat bansa |
POST /api/v1/messages/{id}/cancel | Kanselahin ang schedule bago maipadala, buong refund |
SEND
Pagpapadala
Ang to ay array ng mga numero o text na hinati sa bagong linya. Para gumamit ng numerong walang +, itakda ang country sa default na country code (gaya ng us o kr).
| Field | Paglalarawan |
|---|---|
to | Mga tatanggap. Array o text na hinati sa linya, hanggang 1,000 |
text | Ang mensahe. Hanggang 10 bahagi |
country | Opsyonal. Country code para sa numerong walang + |
schedule_at | Opsyonal. ISO time na may time zone (halimbawa 2026-12-01T09:00:00Z) o Unix seconds, 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.012",
"countries": [
{ "country": "US", "recipients": 1, "cost": "0.0047" },
{ "country": "GB", "recipients": 1, "cost": "0.0073" }
]
},
"rejected": [],
"duplicates": 0,
"opted_out": 0,
"balance": "48.988"
}POST /api/v1/messages
curl -X POST https://smsworld.shop/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://smsworld.shop/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.0147",
"balance": "49.00",
"countries": [
{ "country": "JP", "recipients": 1, "price": "0.01", "cost": "0.01" },
{ "country": "US", "recipients": 1, "price": "0.0047", "cost": "0.0047" }
],
"rejected": [],
"duplicates": 0,
"opted_out": 0
}ERRORS
Mga error code
| Code | HTTP | Kahulugan |
|---|---|---|
unauthorized | 401 | Walang key o mali ang key |
rate_limited | 429 | Lampas sa limit bawat minuto |
bad_request | 400 | Hindi mabasa ang body |
empty_text | 400 | Walang laman ang text |
too_long | 400 | Lampas sa 10 bahagi ang text |
no_numbers | 400 | Walang numerong maipapadala |
too_many | 400 | Mahigit 1,000 numero |
bad_time | 400 | Wala sa saklaw ang oras ng schedule |
low_balance | 402 | Kulang ang balance |
unavailable | 503 | Hindi pa bukas ang pagpapadala (walang siningil) |
not_found | 404 | Walang ganitong padala |
not_scheduled | 409 | Naipadala na o nakansela na |
Limit at patakaran
- Hanggang 120 request bawat minuto bawat key.
- Ang halaga ay string sa US dollar ("0.0047").
- Ang send id ay 12-character na code, hindi sunod-sunod na numero.
- Parehong pagsusuri ng numero at opt-out list gaya ng send screen sa web.