GET
/balance
查詢餘額
回傳您帳號目前的美元餘額。接收驗證碼和發送簡訊使用同一筆餘額。
參數
沒有參數。
請求範例
request
$ curl https://today-sms.com/api/v1/balance \
-H "Authorization: Bearer YOUR_API_KEY"
回應範例
response
{
"balance": "42.5000",
"currency": "USD"
}
可能的錯誤
| unauthorized | 缺少 API 金鑰或金鑰錯誤 |
| not_allowed | 第一筆儲值入帳後才會開放 API |
| rate_limited | 1 分鐘內的請求太多 |
GET
/apps
App 清單
列出目前有號碼的 App。回傳 App 代碼、名稱、最低價格和有號碼的國家數。
參數
沒有參數。
請求範例
request
$ curl https://today-sms.com/api/v1/apps \
-H "Authorization: Bearer YOUR_API_KEY"
回應範例
response
[
{ "app": "telegram", "name": "Telegram", "from": "0.4515", "countries": 61 }
]
可能的錯誤
| unauthorized | 缺少 API 金鑰或金鑰錯誤 |
| not_allowed | 第一筆儲值入帳後才會開放 API |
GET
/prices?app=telegram
App 的國家與價格
回傳一個 App 的國家,從最便宜的開始排列。包含國碼、ISO 代碼、價格和目前可用的號碼數。
參數
| 名稱 | 類型 | 必填 | 說明 |
|---|
| app | string | 必填 | App 代碼(GET /apps 中的 app 值) |
請求範例
request
$ curl https://today-sms.com/api/v1/prices?app=telegram \
-H "Authorization: Bearer YOUR_API_KEY"
回應範例
response
[
{ "country": "indonesia", "iso": "id", "price": "0.4515", "stock": 702866 }
]
可能的錯誤
| bad_request | 缺少必要的值或格式錯誤 |
| unauthorized | 缺少 API 金鑰或金鑰錯誤 |
POST
/numbers
購買號碼
為您選擇的 App 和國家購買號碼。費用從餘額扣除,號碼會在設定時間內等候簡訊。如果確認號碼需要較長時間,會回傳 202 和確認中的狀態。
參數
| 名稱 | 類型 | 必填 | 說明 |
|---|
| app | string | 必填 | App 代碼 |
| country | string | 必填 | 國家代碼(GET /prices 中的 country 值) |
請求範例
request
$ curl -X POST https://today-sms.com/api/v1/numbers \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"app":"telegram","country":"indonesia"}'
回應範例
response
{
"id": "N-7K2M-QX4P-9D3A",
"app": "telegram",
"country": "indonesia",
"phone": "+6281234567890",
"price": "0.4515",
"refunded": "0.0000",
"status": "waiting",
"expires_at": "2026-10-18T09:20:00.000Z",
"sms": []
}
可能的錯誤
| bad_request | 缺少必要的值或格式錯誤 |
| not_enough_balance | 餘額不足,請先儲值 |
| too_many_open | 開放中的號碼太多,請先完成或取消部分號碼 |
| no_numbers | 目前這個 App 和國家沒有號碼 |
GET
/numbers/{id}
號碼狀態與簡訊
回傳號碼的狀態和目前為止收到的所有簡訊。驗證碼也會另外放在 code 中回傳。
參數
| 名稱 | 類型 | 必填 | 說明 |
|---|
| id | string | 必填 | 購買號碼時取得的 id(以 N- 開頭) |
請求範例
request
$ curl https://today-sms.com/api/v1/numbers/N-7K2M-QX4P-9D3A \
-H "Authorization: Bearer YOUR_API_KEY"
回應範例
response
{
"id": "N-7K2M-QX4P-9D3A",
"status": "received",
"sms": [
{ "code": "482913", "text": "Your code is 482913", "at": "2026-10-18T09:02:11.000Z" }
]
}
可能的錯誤
POST
/numbers/{id}/cancel
取消號碼
購買 120 秒後,可取消尚未收到簡訊的號碼。全額會退回您的餘額。
參數
| 名稱 | 類型 | 必填 | 說明 |
|---|
| id | string | 必填 | 號碼 id(以 N- 開頭) |
請求範例
request
$ curl -X POST https://today-sms.com/api/v1/numbers/N-7K2M-QX4P-9D3A/cancel \
-H "Authorization: Bearer YOUR_API_KEY"
回應範例
response
{
"id": "N-7K2M-QX4P-9D3A",
"status": "canceled",
"refunded": "0.4515"
}
可能的錯誤
| too_early | 購買 120 秒後才能取消 |
| has_sms | 已收到簡訊的號碼無法取消 |
| try_again | 取消尚未確認,請 1 分鐘後再試一次 |
| not_found | 您的帳號中沒有這個號碼或訊息 |
POST
/numbers/{id}/finish
完成號碼
收到驗證碼後關閉號碼。關閉的號碼不再接收簡訊。
參數
| 名稱 | 類型 | 必填 | 說明 |
|---|
| id | string | 必填 | 號碼 id(以 N- 開頭) |
請求範例
request
$ curl -X POST https://today-sms.com/api/v1/numbers/N-7K2M-QX4P-9D3A/finish \
-H "Authorization: Bearer YOUR_API_KEY"
回應範例
response
{
"id": "N-7K2M-QX4P-9D3A",
"status": "finished"
}
可能的錯誤
GET
/messages/prices
各國簡訊價格
回傳各國發送簡訊的每則價格。包含 ISO 代碼、國碼和每則簡訊價格(USD)。
參數
沒有參數。
請求範例
request
$ curl https://today-sms.com/api/v1/messages/prices \
-H "Authorization: Bearer YOUR_API_KEY"
回應範例
response
[
{ "iso": "us", "dial": "1", "price": "0.0042" },
{ "iso": "gb", "dial": "44", "price": "0.0066" }
]
可能的錯誤
| unauthorized | 缺少 API 金鑰或金鑰錯誤 |
| not_allowed | 第一筆儲值入帳後才會開放 API |
POST
/messages
發送簡訊
把您的訊息發送給收件人清單。每次請求最多 1,000 位收件人,重複的號碼只會收到一則訊息。加上 at 即可預約在該時間(UTC)發送。發送時會從餘額保留總費用,失敗的分段會退回您的餘額。
參數
| 名稱 | 類型 | 必填 | 說明 |
|---|
| to | string[] | 必填 | 國際格式(含 + 和國碼)的號碼清單,最多 1,000 個 |
| text | string | 必填 | 訊息內容。160 個 GSM-7 字元或 70 個 Unicode 字元為一則簡訊 |
| at | string | 選填 | 預約時間,ISO 8601 UTC(例如 2026-10-18T10:00:00Z) |
| ref | string | 選填 | 您自己的參考值,例如訂單編號,最多 64 個字元 |
請求範例
request
$ curl -X POST https://today-sms.com/api/v1/messages \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to":["+14155550100","+447700900123"],"text":"Your code is 482913"}'
回應範例
response
{
"id": "m_7Q2K9X",
"status": "queued",
"recipients": 2,
"parts": 1,
"encoding": "GSM-7",
"cost": "0.0136"
}
可能的錯誤
| bad_request | 缺少必要的值或格式錯誤 |
| too_many_recipients | 每次請求最多 1,000 位收件人 |
| not_enough_balance | 餘額不足,請先儲值 |
| not_available | 這項商品即將開放。這次請求未被受理,您的餘額也沒有變動 |
GET
/messages/{id}
發送狀態與送達報告
回傳已發送訊息的整體狀態和每位收件人的送達報告。失敗分段的金額會加到 refunded。
參數
| 名稱 | 類型 | 必填 | 說明 |
|---|
| id | string | 必填 | 發送時取得的 id |
請求範例
request
$ curl https://today-sms.com/api/v1/messages/m_7Q2K9X \
-H "Authorization: Bearer YOUR_API_KEY"
回應範例
response
{
"id": "m_7Q2K9X",
"status": "done",
"cost": "0.0136",
"refunded": "0.0083",
"reports": [
{ "to": "+14155550100", "status": "delivered", "at": "2026-10-18T10:00:04Z" },
{ "to": "+447700900123", "status": "failed", "at": "2026-10-18T10:00:09Z" }
]
}
可能的錯誤
POST
/messages/{id}/cancel
取消預約發送
取消尚未送出的預約發送。保留的全部金額會退回您的餘額。
參數
請求範例
request
$ curl -X POST https://today-sms.com/api/v1/messages/m_7Q2K9X/cancel \
-H "Authorization: Bearer YOUR_API_KEY"
回應範例
response
{
"id": "m_7Q2K9X",
"status": "canceled",
"refunded": "0.0136"
}
可能的錯誤
| too_late | 已開始發送的訊息無法取消 |
| not_found | 您的帳號中沒有這個號碼或訊息 |