API 文档
直接在你的应用中管理电话号码、短信和收益。
从一个请求开始
在您的仪表盘中创建一个 API 键,获取一个数字,并每 20 秒检查一次消息。当带有代码的 SMS 到达时,款项就会到账;再次阅读它不会影响您的余额。
https://smscash.org/api/v1https://smscash.org/stubs/handler_api.phpcurl -X POST 'https://smscash.org/api/v1/activations' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: request-unique-001' \
-d '{"service":"go","country":86}'替代兼容接口地址:/handler_api.php. 现有的 REST 集成继续工作。
请求生成器
Idempotency-Key: UUID · POST · 8–128
自动选择:优先比较最近1小时的验证码数量,再比较24小时。没有号码时转到下一个运营商。
curl --max-time 15 --fail-with-body -X POST 'https://smscash.org/api/v1/activations' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: request-unique-001' \
--data '{"service":"go","country":86}'package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
"time"
)
func main() {
payload := []byte("{\"service\":\"go\",\"country\":86}")
req, err := http.NewRequest("POST", "https://smscash.org/api/v1/activations", bytes.NewReader(payload))
if err != nil { panic(err) }
req.Header.Set("Authorization", "Bearer " + os.Getenv("SMSCASH_API_KEY"))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Idempotency-Key", "request-unique-001")
client := &http.Client{Timeout: 15 * time.Second, CheckRedirect: func(_ *http.Request, _ []*http.Request) error { return http.ErrUseLastResponse }}
res, err := client.Do(req)
if err != nil { panic(err) } // Keep the same operation key after a network error.
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil { panic(err) }
if res.StatusCode >= 300 {
fmt.Fprintf(os.Stderr, "HTTP %d, request_id=%s\n%s\n", res.StatusCode, res.Header.Get("X-Request-ID"), body)
os.Exit(1)
}
fmt.Println(string(body))
}// Node.js 18+: set SMSCASH_API_KEY in your environment.
const response = await fetch("https://smscash.org/api/v1/activations", {
method: "POST",
headers: {
Authorization: 'Bearer ' + process.env.SMSCASH_API_KEY,
'Content-Type': 'application/json',
'Idempotency-Key': "request-unique-001",
},
body: JSON.stringify({
"service": "go",
"country": 86
}),
signal: AbortSignal.timeout(15000),
redirect: 'error',
});
const result = await response.json();
if (!response.ok) {
const error = result.error || {};
console.error(response.status, error.code, error.hint, error.request_id);
throw new Error(error.message || 'API error');
}
console.log(result);
// SMS codes are strings: keep leading zeros. Never retry writes automatically.import json
import os
import urllib.error
import urllib.request
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self, req, fp, code, msg, headers, newurl):
return None
headers = {
'Authorization': 'Bearer ' + os.environ['SMSCASH_API_KEY'],
'Content-Type': 'application/json',
'Idempotency-Key': "request-unique-001",
}
request = urllib.request.Request(
"https://smscash.org/api/v1/activations",
headers=headers,
data="{\"service\":\"go\",\"country\":86}".encode('utf-8'),
method="POST",
)
try:
with urllib.request.build_opener(NoRedirect).open(request, timeout=15) as response:
result = json.load(response)
print(result)
except urllib.error.HTTPError as error:
details = json.load(error).get('error', {})
print(error.code, details.get('code'), details.get('hint'), details.get('request_id'))
raise
# No automatic retries; SMS codes remain strings.密钥不会被保存。此验证不会分配号码。
REST 用于新集成
服务和国家
请选择服务和国家。每条短信的报酬由国家决定。
GET /api/v1/catalog?service=go&country=86&page=1&page_size=100
Authorization: Bearer YOUR_API_KEY{
"rows": [
{
"offer_id": 42,
"service": "go",
"service_name": "Google",
"country_id": 86,
"country_name": "Italy",
"provider_id": 1,
"operator": 1,
"provider_name": "Operator 1",
"reward": "0.00300000",
"currency": "USD",
"accounting_precision": 8,
"earnings_hold_days": 45
}
],
"page": 1,
"page_size": 100,
"total": 1,
"pages": 1,
"has_more": false,
"accounting_precision": 8
}service · country · operator · q · page · page_size (1–100)
获取号码
POST /api/v1/activations
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Idempotency-Key: request-unique-001
{
"service": "go",
"country": 86
}自动选择:优先比较最近1小时的验证码数量,再比较24小时。没有号码时转到下一个运营商。
201: new session · 200: replay of the same operation
service + country OR offer_id · duration_minutes: 20
ref: software owner code (optional)
operator: public ID (e.g. 1 for Operator 1), optional · any/0: automatic
country: integer · service: string · SMS code: string电话号码有效期为 20 分钟。每 20 秒检查一次短信,可随时立即取消。
批量查询号码
GET /api/v1/activations/batch?ids=42,43
Authorization: Bearer YOUR_API_KEY{
"rows": [
{
"id": 42,
"found": true,
"phone": "12025550123",
"status": "received",
"service": "go",
"country_id": 86,
"provider_id": 1,
"operator": 1,
"expires_at": "2026-10-10T12:15:00Z",
"sms_count": 1,
"code": "001234",
"last_sms": {
"id": 101,
"code": "001234",
"sender": "Service",
"text": "Code: 001234",
"received_at": "2026-10-10T12:01:00Z"
}
},
{
"id": 43,
"found": false,
"error": {
"code": "NO_ACTIVATION",
"message": "Session not found."
}
}
],
"as_of": "2026-10-10T12:01:00Z",
"poll_interval_seconds": 20
}ids: 1–100 positive session IDs, separated by commas
Input order preserved · duplicates removed
Foreign, unavailable or out-of-scope IDs: found=false
Read only · no supplier requests · last_sms is the latest message余额 · 冻结中
GET /api/v1/balance
Authorization: Bearer YOUR_API_KEY{
"currency": "USD",
"accounting_precision": 8,
"balance": "12.00000000",
"held_balance": "34.50000001",
"balance_minor": "1200000000",
"held_minor": "3450000001",
"as_of": "2026-10-12T20:00:00Z",
"next_release_at": "2026-11-26T20:00:00Z"
}balance — 可用; held_balance — 冻结中. USD · 8
只能提现冻结期已结束的资金。
开箱即用的客户端
import {SmScash, SmScashError} from './smscash.mjs';
import {randomUUID} from 'node:crypto';
const api = new SmScash(process.env.SMSCASH_API_KEY);
const catalog = await api.catalog({service: 'go', country: 86});
console.log(catalog.rows);
// Save this key before sending; keep it for retries of this operation.
const requestKey = randomUUID();
const session = await api.createNumber({service: 'go', country: 86}, requestKey);
// After 20 seconds:
const messages = await api.sms(session.id, {afterId: 0});
console.log(messages.sms);
const statuses = await api.batch([session.id]);
const held = await api.holdBalance();
console.log(held); // Exact USD stringimport os
import uuid
from smscash import SmScash, SmScashError
api = SmScash(os.environ['SMSCASH_API_KEY'])
catalog = api.catalog(service='go', country=86)
print(catalog['rows'])
# Save this key before sending; keep it for retries of this operation.
request_key = str(uuid.uuid4())
session = api.create_number({'service': 'go', 'country': 86}, request_key)
# After 20 seconds:
messages = api.sms(session['id'], after_id=0)
print(messages['sms'])
statuses = api.batch([session['id']])
held = api.hold_balance()
print(held) # Exact USD stringme() · balance() · holdBalance()/hold_balance() · catalog() · activation() · sms() · batch()
createNumber(parameters, requestKey) / create_number(parameters, request_key)
setStatus(id, "cancel") / set_status(id, "cancel")
setStatus(id, "retry", requestKey) / set_status(id, "retry", request_key)
Timeout: 15 s · no dependencies · no automatic retries
Error: code · status · hint · requestId/request_id · retryable
ALLOCATION_UNCERTAIN: contact support with request_id; never retry automatically.SMS-Activate / HeroSMS
https://smscash.org/sms-activate/stubs/handler_api.phphttps://smscash.org/hero-sms/stubs/handler_api.php用户的个人 API 密钥。
请选择服务和国家。每条短信的报酬由国家决定。
| 代码 | 描述 |
|---|---|
getNumber / getNumberV2 | 获取号码 |
getStatus / getStatusV2 | 获取最新代码 |
setStatus / finishActivation / cancelActivation | 管理会话 |
getPrices / getNumbersStatus | 检查空房情况 |
getRewards (SMScash) | SMS的奖励 |
getServicesList / getServices | 服务 |
getCountries / getOperators | 服务和国家 |
getActiveActivations | 会议 |
getBalance | 用户余额 |
getHoldBalance (SMScash) | 冻结中 |
cost = 0 USD · activationCost = 0 USDreward — SMS的奖励
curl --get 'https://smscash.org/hero-sms/stubs/handler_api.php' \
--data-urlencode 'api_key=YOUR_API_KEY' \
--data-urlencode 'action=getNumberV2' \
--data-urlencode 'service=go' \
--data-urlencode 'country=86' \
-H 'Idempotency-Key: request-unique-001'{
"activationId": "42",
"phoneNumber": "393331234567",
"activationCost": 0,
"currency": 840,
"countryCode": 86,
"canGetAnotherSms": true,
"activationTime": "2026-10-11T12:00:00Z",
"activationEndTime": "2026-10-11T12:15:00Z",
"reward": "0.00300000"
}GET or POST application/x-www-form-urlencoded
api_key · action · service · country · ref (optional)
setStatus: 1 → ACCESS_READY · 3 → ACCESS_RETRY_GET
6 → ACCESS_ACTIVATION · 8 → ACCESS_CANCEL
getStatus: STATUS_WAIT_CODE · STATUS_OK:001234 · STATUS_CANCEL
getStatusV2: {"verificationType":1,"sms":null,"call":null}
getServicesList: {"status":"success","services":[{"code":"go","name":"Google"}]}
getCountries: {"86":{"id":86,"eng":"Italy","visible":1,"retry":1,"rent":0}}
getPrices: {"86":{"go":{"cost":0,"count":12,"reward":"0.00300000","currency":"USD"}}}
getRewards: {"59":{"vi":{"1":"0.01000000"}}}
getRewards filters: country · service · operator (optional); any/0: all permitted providers
getActiveActivations: start=0 · limit=1–100 · activeActivations / data
Business/key errors: HTTP 200 + plain text · server errors: HTTP 500
Availability: actual supplier pool, shared cache up to 20 s; not a reservation
No automatic retries after a transport error or ALLOCATION_UNCERTAIN.
Keep the original Idempotency-Key and parameters.
Unsupported: rent · calls · forwarding · multiple services per number · prolong
Unsupported options return BAD_REQUEST; unsupported actions return BAD_ACTION.
SMScash keys and country/service codes; configure this base URL in your software.电话号码有效期为 20 分钟。每 20 秒检查一次短信,可随时立即取消。
身份验证与重试
REST: 标头 Authorization: Bearer YOUR_API_KEY. 兼容接口: 参数 api_key 和 action。使用HTTPS。
要管理 API 密钥,请输入您的帐户。
API 请求频率和电话号码数量均无限制。没有每日或每小时配额。
电话号码有效期为 20 分钟。每 20 秒检查一次短信,可随时立即取消。
在REST中,一个独特的 Idempotency-Key 号码分配、重复分配、retry 和支付请求需要。它是可选的,但在 handler_api.php 中推荐。重试网络请求时重复使用密钥;使用新密钥进行新操作。
API 密钥范围
可将密钥限定于特定服务、国家和供应商。列表为空时,允许所有可用选项。
{
"label": "我的软件",
"policy": {
"services": [
"go"
],
"countries": [
86
],
"providers": [
1
]
}
}PATCH /api/v1/keys/{id} 完全更改名称和 policy。该秘密仅在创建时显示。
总共10%。 5% + 5% 软件代码。
发放号码时,请提供 ref 该软件的所有者。该请求由用户的密钥授权。该代码位于“推荐”部分和 GET /api/v1/referrals → software_ref.
| 请求 | 邀请人 | 软件 |
|---|---|---|
| 不带ref | 10% | — |
| 配ref | 5% | 5% |
| 使用 ref,无推荐人 | — | 5% |
平台在不减少用户收入的情况下发放奖金。软件所有者和推荐人可以是同一个人。用户不能使用自己的代码。
条款在创建会话时确定;阅读 SMS 和 retry 不会改变它们。再次输入 ref 以创建新的重复会话。在费用计算中,USD 0.003 的用户奖励分别给予 USD 0.00015 软件所有者和推荐者。总奖金为 USD 0.00030。
API 命令
11 种 XVBC 风格的方法加上您的 SMScash 余额。
GETgetNumber获取号码+
创建会话并为用户预留可用号码。报酬标准及推荐奖励的接收者在分配时确定;收到包含验证码的 SMS 后才会计入报酬。
参数
| 参数 | 类型 | 描述 |
|---|---|---|
api_key* | string | 用户的个人 API 密钥。 |
service* | string | 可用的服务代码。答案仅限于API钥匙的区域。 |
country* | integer | 从 getCountries 取 ID。 |
operator | string | 从 operators/getOperators (API) 取 ID。 operator=1 · any/0 |
session_duration | integer | 会议持续 20 分钟。通过 20 或省略此参数。 |
with_operator | integer | 1 在响应中添加运营商 ID;0 或省略参数时返回三个部分。 |
ref | string | 软件所有者的公共代码:他自己5%,邀请者5%。没有 ref - 10% 给邀请者。 |
* 必填参数。在所有请求中还传递 action=getNumber。
请求示例
curl 'https://smscash.org/stubs/handler_api.php?action=getNumber&api_key=YOUR_API_KEY&service=go&country=86&with_operator=1' \
-H 'Idempotency-Key: request-unique-001'package main
import (
"fmt"
"io"
"net/http"
"time"
)
func main() {
req, err := http.NewRequest("GET", "https://smscash.org/stubs/handler_api.php?action=getNumber&api_key=YOUR_API_KEY&service=go&country=86&with_operator=1", nil)
if err != nil { panic(err) }
req.Header.Set("Idempotency-Key", "request-unique-001")
client := &http.Client{Timeout: 15 * time.Second}
resp, err := client.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil { panic(err) }
fmt.Println(resp.StatusCode, string(body))
}const response = await fetch("https://smscash.org/stubs/handler_api.php?action=getNumber&api_key=YOUR_API_KEY&service=go&country=86&with_operator=1", {
headers: {"Idempotency-Key": "request-unique-001"}
});
const result = await response.text();
console.log(response.status, result);import requests
response = requests.get(
"https://smscash.org/stubs/handler_api.php?action=getNumber&api_key=YOUR_API_KEY&service=go&country=86&with_operator=1",
headers={"Idempotency-Key": "request-unique-001"},
timeout=15,
)
print(response.status_code, response.text)回应
ACCESS_NUMBER:42:380670000000:1EMPTY_POOL- 自动选择:优先比较最近1小时的验证码数量,再比较24小时。没有号码时转到下一个运营商。
- 通过 Idempotency-Key:具有相同密钥的相同请求返回上一个会话。更改参数调用 IDEMPOTENCY_CONFLICT。
- 没有池的数字国家给出 EMPTY_POOL;错误的国家/地区格式是 BAD_COUNTRY。
- 被删除会话的密钥仍被使用:使用该密钥进行重新分配会返回 SESSION_CLOSED,不会生成另一个号码。
- 分配结果尚未确认。为避免分配第二个号码,已禁用自动重试。
GETgetNumbersStatus检查空房情况+
按服务和国家统计的可用电话号码数量。
参数
| 参数 | 类型 | 描述 |
|---|---|---|
api_key* | string | 用户的个人 API 密钥。 |
country* | integer | 从 getCountries 取 ID。 |
* 必填参数。在所有请求中还传递 action=getNumbersStatus。
请求示例
curl 'https://smscash.org/stubs/handler_api.php?action=getNumbersStatus&api_key=YOUR_API_KEY&country=86'package main
import (
"fmt"
"io"
"net/http"
"time"
)
func main() {
req, err := http.NewRequest("GET", "https://smscash.org/stubs/handler_api.php?action=getNumbersStatus&api_key=YOUR_API_KEY&country=86", nil)
if err != nil { panic(err) }
client := &http.Client{Timeout: 15 * time.Second}
resp, err := client.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil { panic(err) }
fmt.Println(resp.StatusCode, string(body))
}const response = await fetch("https://smscash.org/stubs/handler_api.php?action=getNumbersStatus&api_key=YOUR_API_KEY&country=86");
const result = await response.json();
console.log(response.status, result);import requests
response = requests.get(
"https://smscash.org/stubs/handler_api.php?action=getNumbersStatus&api_key=YOUR_API_KEY&country=86",
timeout=15,
)
print(response.status_code, response.json())回应
{
"go_0": 0
}- _0 后缀表示没有特定运算符的选择。
- 可用数量指供应商的整个号码池。分配号码时会检查所选渠道是否可用。
GETgetStatus获取最新代码+
轻松请求会话状态和最后的 SMS 代码。代码中的前导零被保留。
参数
| 参数 | 类型 | 描述 |
|---|---|---|
api_key* | string | 用户的个人 API 密钥。 |
id* | integer | 您的会话的 ID,在发出号码时收到。 |
* 必填参数。在所有请求中还传递 action=getStatus。
请求示例
curl 'https://smscash.org/stubs/handler_api.php?action=getStatus&api_key=YOUR_API_KEY&id=42'package main
import (
"fmt"
"io"
"net/http"
"time"
)
func main() {
req, err := http.NewRequest("GET", "https://smscash.org/stubs/handler_api.php?action=getStatus&api_key=YOUR_API_KEY&id=42", nil)
if err != nil { panic(err) }
client := &http.Client{Timeout: 15 * time.Second}
resp, err := client.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil { panic(err) }
fmt.Println(resp.StatusCode, string(body))
}const response = await fetch("https://smscash.org/stubs/handler_api.php?action=getStatus&api_key=YOUR_API_KEY&id=42");
const result = await response.text();
console.log(response.status, result);import requests
response = requests.get(
"https://smscash.org/stubs/handler_api.php?action=getStatus&api_key=YOUR_API_KEY&id=42",
timeout=15,
)
print(response.status_code, response.text)回应
STATUS_WAIT_CODESTATUS_OK:001234STATUS_CANCELNO_ACTIVATION- 每 20 秒进行一次投票。再次阅读消息不会产生新的支付。
- 在 retry 之后,不返回旧代码:getStatus 等待下一个 SMS。
- 当 SMS 之后的数字被删除后,getStatus 和 getSms 会返回 STATUS_CANCEL;getSmsFull 则返回关闭状态、空电话和空短信列表。REST /activations/{id} 和 /sms 会返回 404 NO_ACTIVATION。
GETsetStatus管理会话+
完成、取消或继续等待 SMS。会话有效期保持不变。
参数
| 参数 | 类型 | 描述 |
|---|---|---|
api_key* | string | 用户的个人 API 密钥。 |
id* | integer | 您的会话的 ID,在发出号码时收到。 |
status* | integer | 3 — 无需延长会话,等待下一个代码;6 — 在 SMS 完成后结束;8 — 立即取消。 |
* 必填参数。在所有请求中还传递 action=setStatus。
请求示例
curl 'https://smscash.org/stubs/handler_api.php?action=setStatus&api_key=YOUR_API_KEY&id=42&status=3' \
-H 'Idempotency-Key: request-unique-001'package main
import (
"fmt"
"io"
"net/http"
"time"
)
func main() {
req, err := http.NewRequest("GET", "https://smscash.org/stubs/handler_api.php?action=setStatus&api_key=YOUR_API_KEY&id=42&status=3", nil)
if err != nil { panic(err) }
req.Header.Set("Idempotency-Key", "request-unique-001")
client := &http.Client{Timeout: 15 * time.Second}
resp, err := client.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil { panic(err) }
fmt.Println(resp.StatusCode, string(body))
}const response = await fetch("https://smscash.org/stubs/handler_api.php?action=setStatus&api_key=YOUR_API_KEY&id=42&status=3", {
headers: {"Idempotency-Key": "request-unique-001"}
});
const result = await response.text();
console.log(response.status, result);import requests
response = requests.get(
"https://smscash.org/stubs/handler_api.php?action=setStatus&api_key=YOUR_API_KEY&id=42&status=3",
headers={"Idempotency-Key": "request-unique-001"},
timeout=15,
)
print(response.status_code, response.text)回应
ACCESS_RETRY_GETACCESS_ACTIVATIONACCESS_CANCEL- 在原 20 分钟内重试,等待下一个代码。问题及过期时间不变。
- 对于 status=3,请使用 Idempotency-Key:重复请求不会重置已收到的新代码。 SMS 的历史仍然可用。
- 取消不会扣除已获得的报酬。
- 只有带有 SMS 代码的号码被保留在历史中。没有代码的被取消和过期的号码则会被删除。
GETgetRepeatNumber再次发出相同的号码+
使用历史记录中的特定号码打开一个新会话。您可以选择同一国家/地区的其他可用服务。
参数
| 参数 | 类型 | 描述 |
|---|---|---|
api_key* | string | 用户的个人 API 密钥。 |
number* | string | 你的旧号码。只允许使用数字和可选的前导 +。 |
service* | string | 可用的服务代码。答案仅限于API钥匙的区域。 |
session_duration | integer | 会议持续 20 分钟。通过 20 或省略此参数。 |
with_operator | integer | 1 在响应中添加运营商 ID;0 或省略参数时返回三个部分。 |
ref | string | 软件所有者的公共代码:他自己5%,邀请者5%。没有 ref - 10% 给邀请者。 |
operator | string | 从 operators/getOperators (API) 取 ID。 operator=1 · any/0 |
* 必填参数。在所有请求中还传递 action=getRepeatNumber。
请求示例
curl 'https://smscash.org/stubs/handler_api.php?action=getRepeatNumber&api_key=YOUR_API_KEY&number=380670000000&service=go' \
-H 'Idempotency-Key: request-unique-001'package main
import (
"fmt"
"io"
"net/http"
"time"
)
func main() {
req, err := http.NewRequest("GET", "https://smscash.org/stubs/handler_api.php?action=getRepeatNumber&api_key=YOUR_API_KEY&number=380670000000&service=go", nil)
if err != nil { panic(err) }
req.Header.Set("Idempotency-Key", "request-unique-001")
client := &http.Client{Timeout: 15 * time.Second}
resp, err := client.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil { panic(err) }
fmt.Println(resp.StatusCode, string(body))
}const response = await fetch("https://smscash.org/stubs/handler_api.php?action=getRepeatNumber&api_key=YOUR_API_KEY&number=380670000000&service=go", {
headers: {"Idempotency-Key": "request-unique-001"}
});
const result = await response.text();
console.log(response.status, result);import requests
response = requests.get(
"https://smscash.org/stubs/handler_api.php?action=getRepeatNumber&api_key=YOUR_API_KEY&number=380670000000&service=go",
headers={"Idempotency-Key": "request-unique-001"},
timeout=15,
)
print(response.status_code, response.text)回应
ACCESS_NUMBER:43:380670000000NUMBER_IN_USE- 首先,结束或取消当前会话。如果号码占线,则不进行补发。
- 新会话收到新的 ID 和当前费率。旧的 SMS 没有复制到其中。 ref 再次设置。
- SMScash 只允许重复该帐户历史记录中的数字。国家是通过数字来识别的。
- 被删除会话的密钥仍被使用:使用该密钥进行重新分配会返回 SESSION_CLOSED,不会生成另一个号码。
GETgetSmsFull获取 SMS 为 JSON+
所有消息的结构化历史记录,包括 ID、发件人、代码、文本和国家/地区、服务和供应商数据。
参数
| 参数 | 类型 | 描述 |
|---|---|---|
api_key* | string | 用户的个人 API 密钥。 |
id* | integer | 您的会话的 ID,在发出号码时收到。 |
* 必填参数。在所有请求中还传递 action=getSmsFull。
请求示例
curl 'https://smscash.org/stubs/handler_api.php?action=getSmsFull&api_key=YOUR_API_KEY&id=42'package main
import (
"fmt"
"io"
"net/http"
"time"
)
func main() {
req, err := http.NewRequest("GET", "https://smscash.org/stubs/handler_api.php?action=getSmsFull&api_key=YOUR_API_KEY&id=42", nil)
if err != nil { panic(err) }
client := &http.Client{Timeout: 15 * time.Second}
resp, err := client.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil { panic(err) }
fmt.Println(resp.StatusCode, string(body))
}const response = await fetch("https://smscash.org/stubs/handler_api.php?action=getSmsFull&api_key=YOUR_API_KEY&id=42");
const result = await response.json();
console.log(response.status, result);import requests
response = requests.get(
"https://smscash.org/stubs/handler_api.php?action=getSmsFull&api_key=YOUR_API_KEY&id=42",
timeout=15,
)
print(response.status_code, response.json())回应
{
"success": true,
"session_id": 42,
"phone": "380670000000",
"status": 1,
"status_name": "received",
"sms_count": 1,
"sms": [
{
"id": 101,
"external_id": "message-101",
"sender": "Service",
"code": "001234",
"text": "Код подтверждения: 001234",
"received_at": "2026-10-09T12:00:00Z",
"country": {
"id": 86,
"name": "Italy"
},
"service": {
"code": "go",
"name": "Google"
},
"provider": {
"id": 1,
"name": "Оператор 1"
}
}
],
"expires_at": "2026-10-09T12:20:00Z"
}- 集成的首选格式。请记住 sms[].id 仅处理新消息。
- 数字状态 SMScash:1 - 有效,6 - 已完成,8 - 取消或过期。 status_name 区分等待、已接收、已完成、已取消、已过期。
- 会话结束后,已接收的代码仍然可用。对于大量数据,请使用 REST /activations/{id}/sms 和 after_id。
- 当 SMS 之后的数字被删除后,getStatus 和 getSms 会返回 STATUS_CANCEL;getSmsFull 则返回关闭状态、空电话和空短信列表。REST /activations/{id} 和 /sms 会返回 404 NO_ACTIVATION。
GETgetSms获取 SMS 作为文本字符串+
以字符串格式返回现有客户端的整个 SMS 历史记录。
参数
| 参数 | 类型 | 描述 |
|---|---|---|
api_key* | string | 用户的个人 API 密钥。 |
id* | integer | 您的会话的 ID,在发出号码时收到。 |
* 必填参数。在所有请求中还传递 action=getSms。
请求示例
curl 'https://smscash.org/stubs/handler_api.php?action=getSms&api_key=YOUR_API_KEY&id=42'package main
import (
"fmt"
"io"
"net/http"
"time"
)
func main() {
req, err := http.NewRequest("GET", "https://smscash.org/stubs/handler_api.php?action=getSms&api_key=YOUR_API_KEY&id=42", nil)
if err != nil { panic(err) }
client := &http.Client{Timeout: 15 * time.Second}
resp, err := client.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil { panic(err) }
fmt.Println(resp.StatusCode, string(body))
}const response = await fetch("https://smscash.org/stubs/handler_api.php?action=getSms&api_key=YOUR_API_KEY&id=42");
const result = await response.text();
console.log(response.status, result);import requests
response = requests.get(
"https://smscash.org/stubs/handler_api.php?action=getSms&api_key=YOUR_API_KEY&id=42",
timeout=15,
)
print(response.status_code, response.text)回应
STATUS_OK:2026-10-09T12:00:00Z|001234|Код подтверждения: 001234STATUS_WAIT_CODESTATUS_CANCEL- 消息格式:时间|代码|文本。多条消息由冒号分隔。
- 文本 SMS 本身可能包含冒号和竖线。为了进行可靠的解析,请使用 getSmsFull。
GETgetServices服务+
可用的服务代码。答案仅限于API钥匙的区域。
参数
| 参数 | 类型 | 描述 |
|---|---|---|
api_key* | string | 用户的个人 API 密钥。 |
country | integer | 从 getCountries 取 ID。 |
* 必填参数。在所有请求中还传递 action=getServices。
请求示例
curl 'https://smscash.org/stubs/handler_api.php?action=getServices&api_key=YOUR_API_KEY'package main
import (
"fmt"
"io"
"net/http"
"time"
)
func main() {
req, err := http.NewRequest("GET", "https://smscash.org/stubs/handler_api.php?action=getServices&api_key=YOUR_API_KEY", nil)
if err != nil { panic(err) }
client := &http.Client{Timeout: 15 * time.Second}
resp, err := client.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil { panic(err) }
fmt.Println(resp.StatusCode, string(body))
}const response = await fetch("https://smscash.org/stubs/handler_api.php?action=getServices&api_key=YOUR_API_KEY");
const result = await response.json();
console.log(response.status, result);import requests
response = requests.get(
"https://smscash.org/stubs/handler_api.php?action=getServices&api_key=YOUR_API_KEY",
timeout=15,
)
print(response.status_code, response.json())回应
{
"go": {
"name": "Google",
"code": "go"
}
}- 服务目录由供应商共享。数量可用性则单独核查。
GETgetCountries国家+
所选频道中各国家的编号、名称和通话代码。
参数
| 参数 | 类型 | 描述 |
|---|---|---|
api_key* | string | 用户的个人 API 密钥。 |
* 必填参数。在所有请求中还传递 action=getCountries。
请求示例
curl 'https://smscash.org/stubs/handler_api.php?action=getCountries&api_key=YOUR_API_KEY'package main
import (
"fmt"
"io"
"net/http"
"time"
)
func main() {
req, err := http.NewRequest("GET", "https://smscash.org/stubs/handler_api.php?action=getCountries&api_key=YOUR_API_KEY", nil)
if err != nil { panic(err) }
client := &http.Client{Timeout: 15 * time.Second}
resp, err := client.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil { panic(err) }
fmt.Println(resp.StatusCode, string(body))
}const response = await fetch("https://smscash.org/stubs/handler_api.php?action=getCountries&api_key=YOUR_API_KEY");
const result = await response.json();
console.log(response.status, result);import requests
response = requests.get(
"https://smscash.org/stubs/handler_api.php?action=getCountries&api_key=YOUR_API_KEY",
timeout=15,
)
print(response.status_code, response.json())回应
{
"86": {
"id": 86,
"name": "Italy",
"phone_code": "39"
}
}GETgetOperators运营商+
可用运营商:API ID、名称和奖励冻结期限。
参数
| 参数 | 类型 | 描述 |
|---|---|---|
api_key* | string | 用户的个人 API 密钥。 |
country | integer | 从 getCountries 取 ID。 |
operator | string | 从 operators/getOperators (API) 取 ID。 operator=1 · any/0 |
* 必填参数。在所有请求中还传递 action=getOperators。
请求示例
curl 'https://smscash.org/stubs/handler_api.php?action=getOperators&api_key=YOUR_API_KEY'package main
import (
"fmt"
"io"
"net/http"
"time"
)
func main() {
req, err := http.NewRequest("GET", "https://smscash.org/stubs/handler_api.php?action=getOperators&api_key=YOUR_API_KEY", nil)
if err != nil { panic(err) }
client := &http.Client{Timeout: 15 * time.Second}
resp, err := client.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil { panic(err) }
fmt.Println(resp.StatusCode, string(body))
}const response = await fetch("https://smscash.org/stubs/handler_api.php?action=getOperators&api_key=YOUR_API_KEY");
const result = await response.json();
console.log(response.status, result);import requests
response = requests.get(
"https://smscash.org/stubs/handler_api.php?action=getOperators&api_key=YOUR_API_KEY",
timeout=15,
)
print(response.status_code, response.json())回应
{
"1": {
"id": 1,
"provider_id": 1,
"operator": 1,
"name": "Оператор 1",
"earnings_hold_days": 45
}
}- 从 operators/getOperators (API) 取 ID。
GETgetRewardsSMS的奖励+
费率因国家而异。所有表格中的金额均为每付费 SMS 单位的价格。
参数
| 参数 | 类型 | 描述 |
|---|---|---|
api_key* | string | 用户的个人 API 密钥。 |
country | integer | 从 getCountries 取 ID。 |
service | string | 可用的服务代码。答案仅限于API钥匙的区域。 |
operator | string | 从 operators/getOperators (API) 取 ID。 operator=1 · any/0 |
* 必填参数。在所有请求中还传递 action=getRewards。
请求示例
curl 'https://smscash.org/stubs/handler_api.php?action=getRewards&api_key=YOUR_API_KEY&country=59&service=vi'package main
import (
"fmt"
"io"
"net/http"
"time"
)
func main() {
req, err := http.NewRequest("GET", "https://smscash.org/stubs/handler_api.php?action=getRewards&api_key=YOUR_API_KEY&country=59&service=vi", nil)
if err != nil { panic(err) }
client := &http.Client{Timeout: 15 * time.Second}
resp, err := client.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil { panic(err) }
fmt.Println(resp.StatusCode, string(body))
}const response = await fetch("https://smscash.org/stubs/handler_api.php?action=getRewards&api_key=YOUR_API_KEY&country=59&service=vi");
const result = await response.json();
console.log(response.status, result);import requests
response = requests.get(
"https://smscash.org/stubs/handler_api.php?action=getRewards&api_key=YOUR_API_KEY&country=59&service=vi",
timeout=15,
)
print(response.status_code, response.json())回应
{
"59": {
"vi": {
"1": "0.01000000",
"3": "0.00500000"
}
}
}{}- USD关税金额以具有 8 位小数的精确小数字符串形式返回:
- 已启用可用于您的密钥的提供商。
- country ID → service code → operator ID → reward (USD)
GETgetBalance用户余额+
加法 SMScash:考虑到应计费用、推荐奖金和付款请求后的可用余额。
参数
| 参数 | 类型 | 描述 |
|---|---|---|
api_key* | string | 用户的个人 API 密钥。 |
* 必填参数。在所有请求中还传递 action=getBalance。
请求示例
curl 'https://smscash.org/stubs/handler_api.php?action=getBalance&api_key=YOUR_API_KEY'package main
import (
"fmt"
"io"
"net/http"
"time"
)
func main() {
req, err := http.NewRequest("GET", "https://smscash.org/stubs/handler_api.php?action=getBalance&api_key=YOUR_API_KEY", nil)
if err != nil { panic(err) }
client := &http.Client{Timeout: 15 * time.Second}
resp, err := client.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil { panic(err) }
fmt.Println(resp.StatusCode, string(body))
}const response = await fetch("https://smscash.org/stubs/handler_api.php?action=getBalance&api_key=YOUR_API_KEY");
const result = await response.text();
console.log(response.status, result);import requests
response = requests.get(
"https://smscash.org/stubs/handler_api.php?action=getBalance&api_key=YOUR_API_KEY",
timeout=15,
)
print(response.status_code, response.text)回应
ACCESS_BALANCE:0.00- getBalance 返回可用 USD 余额,最多保留 8 位小数。
- 只能提现冻结期已结束的资金。
GETgetHoldBalance冻结中+
收到短信后,收益将按供应商规定的期限冻结。到指定日期,金额会自动变为可提现。
参数
| 参数 | 类型 | 描述 |
|---|---|---|
api_key* | string | 用户的个人 API 密钥。 |
* 必填参数。在所有请求中还传递 action=getHoldBalance。
请求示例
curl 'https://smscash.org/stubs/handler_api.php?action=getHoldBalance&api_key=YOUR_API_KEY'package main
import (
"fmt"
"io"
"net/http"
"time"
)
func main() {
req, err := http.NewRequest("GET", "https://smscash.org/stubs/handler_api.php?action=getHoldBalance&api_key=YOUR_API_KEY", nil)
if err != nil { panic(err) }
client := &http.Client{Timeout: 15 * time.Second}
resp, err := client.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil { panic(err) }
fmt.Println(resp.StatusCode, string(body))
}const response = await fetch("https://smscash.org/stubs/handler_api.php?action=getHoldBalance&api_key=YOUR_API_KEY");
const result = await response.text();
console.log(response.status, result);import requests
response = requests.get(
"https://smscash.org/stubs/handler_api.php?action=getHoldBalance&api_key=YOUR_API_KEY",
timeout=15,
)
print(response.status_code, response.text)回应
ACCESS_HOLD_BALANCE:34.50000001- SMScash · getHoldBalance · USD · 8
- 只能提现冻结期已结束的资金。
响应代码和重复请求
在handler_api.php中,业务成果通常带有HTTP 200。检查正文。目录和getSmsFull如果成功则返回JSON;错误始终是文本。
| 代码 | HTTP | 原因和下一步 |
|---|---|---|
TARIFF_NOT_CONFIGURED | 200 | 费率尚未确定一旦 SMS 奖励被配置,数字分配就会开始。 |
COUNTRY_BLOCKED | 200 | 该国家的编号分配被阻止了。选择另一个国家。 |
BAD_SERVICE | 200 | 此服务已被禁止分配号码。请选择其他服务。 |
PROVIDER_NOT_READY | 200 | 编号分配暂时无法使用刷新 API 目录。 |
BAD_KEY | 400 | 没有 api_key 或格式无效。检查请求中的密钥。 |
INVALID_API_KEY | 401 | 密钥未知、已被撤销或帐户已被禁用。创建有效的 API 密钥。 |
BAD_COUNTRY | 400 | 国家/地区缺失或不是正数。从 getCountries 取 ID。 |
BAD_SESSION_DURATION | 400 | 电话号码的发放时长为恰好 20 分钟。正确的是session_duration。 |
BAD_REQUEST | 400 | 无效参数或 Idempotency-Key。请更正您的要求。 |
BAD_SERVICE / BAD_OPERATOR / INVALID_PROVIDER | 200 | 未知或禁用的目录项。刷新 API 目录。 |
BAD_NUMBER | 200 | 数字格式不正确。给出数字。 |
BAD_ACTION / BAD_STATUS | 200 | 未知命令、ID 或操作。检查设置。 |
EMPTY_POOL | 200 | 目前没有匹配的电话号码。10-30 秒后重复或更换过滤器。 |
NUMBER_IN_USE | 200 | 活动会话占用特定号码。结束会话或选择另一个号码。 |
NO_ACTIVATION | 200 | 该会话或之前的号码不属于您的帐户。检查 ID 和密钥。 |
SESSION_CLOSED / SMS_REQUIRED | 200 | 状态转换当前不可用。检查 SMS 的状况和可用性。 |
SCOPE_BLOCKED | 200 | 该服务、国家/地区或供应商未获得密钥授权。更新 API 密钥的范围。 |
IDEMPOTENCY_CONFLICT | 200 | 该查询键已与其他参数关联。对于新操作,创建另一个 Idempotency-Key。 |
BAD_REF / SELF_REF | 400 | 软件代码未知、已禁用或属于用户本人。传递软件所有者的代码。 |
INTERNAL_ERROR | 500 | 服务器或供应商临时错误。延迟并重复相同的 Idempotency-Key。 |
ALLOCATION_PENDING | 200 | 号码请求正在处理中。请使用相同的 Idempotency-Key 重试。号码请求正在处理中。请使用相同的 Idempotency-Key 重试。 |
ALLOCATION_UNCERTAIN | 200 | 分配结果尚未确认。为避免分配第二个号码,已禁用自动重试。分配结果尚未确认。为避免分配第二个号码,已禁用自动重试。 |
REST 返回一个对象 {"error":{"code":"…","message":"…"}} 和常规 HTTP 状态 400/401/403/404/409/503.
{
"error": {
"code": "BAD_REQUEST",
"message": "检查请求字段。",
"request_id": "req_…",
"hint": "Use the documented JSON type; numbers must not be quoted.",
"retryable": false,
"details": {
"field": "country",
"expected": "integer"
}
}
}X-Request-ID: included in every API response
405: Allow lists the supported HTTP methods
ALLOCATION_PENDING: retryable=true · Retry-After=3 · same operation key
ALLOCATION_UNCERTAIN: retryable=false · contact support
Transport errors: check the operation before another write; keep the original key.REST 用于新集成
USD关税金额以具有 8 位小数的精确小数字符串形式返回: 0.00300000 USD.
余额币种为 USD。请求和响应结构详见 OpenAPI.
/api/v1/catalog服务和国家/api/v1/tariffsSMS 各国家的奖励比例/api/v1/offers费率和奖励/api/v1/services目录/api/v1/countries目录/api/v1/operators目录/api/v1/availability?country=1号码可用情况/api/v1/activations新会话/api/v1/activations/batch?ids=42,43批量查询号码/api/v1/activations最新 200 会话:scope=history,正在等待或全部/api/v1/activations/{id}会话和消息/api/v1/activations/{id}/sms?after_id=0&limit=100新款SMS 带光标/api/v1/activations/{id}/retry等待SMS/api/v1/activations/{id}/finish完成/api/v1/activations/{id}/cancel取消/api/v1/activations/repeat号码补发/api/v1/keysAPI按键/api/v1/keys创建密钥/api/v1/keys/{id}更改名称或policy/api/v1/keys/{id}撤销密钥/api/v1/referrals推荐码和收入/api/v1/summary余额与总结/api/v1/balance冻结中/api/v1/ledger收益分类账/api/v1/withdrawals付款请求/api/v1/withdrawals创建请求/api/v1/statistics总体统计数据/api/v1/earnings/holds收益冻结仅收到新的 SMS
GET /api/v1/activations/42/sms?after_id=0&limit=100
Authorization: Bearer YOUR_API_KEY{
"session_id": 42,
"sms": [
{
"id": 101,
"code": "001234",
"text": "代码:001234",
"sender": "Service",
"received_at": "2026-10-09T12:00:00Z"
}
],
"next_cursor": 101,
"has_more": false
}保存 next_cursor 并将其传递为 after_id。如果has_more=true,则可以立即读取下一页。 limit:1–200。会话和 SMS 仅供所有者使用。