本教程带你在 5 分钟内跑通 SimSmsBox 的核心流程:取号 → 收码 → 取消(可选)。
准备工作
- 注册并登录用户后台。
- 在「钱包」充值少量余额(用于按单扣费)。
- 在「API Key」页面创建一个 Key,形如
psk_xxxxxxxx。
所有接口都通过请求头
X-API-Key鉴权。
第一步:查询某国家可用应用与价格
curl "https://api.simsmsbox.com/api/sms/shop/market?country=US&cardKind=physical" \
-H "X-API-Key: psk_xxxxxxxx"
返回该国家下各应用(如 telegram)的实时价格与库存,其中的 service 字段就是下单要传的服务代码。
第二步:取号(创建订单)
curl -X POST https://api.simsmsbox.com/api/sms/orders/purchase \
-H "X-API-Key: psk_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"service":"telegram","country":"US","cardKind":"physical","rentDays":30}'
返回:
{ "orderId": 19, "phone": "+1xxxxxxxxxx", "status": "waiting" }
第三步:轮询验证码
{id} 用上一步返回的 orderId:
curl https://api.simsmsbox.com/api/sms/orders/19 \
-H "X-API-Key: psk_xxxxxxxx"
收到后,验证码在 latestCode 字段:
{ "orderId": 19, "status": "received", "latestCode": "123456" }
第四步:取消订单(可选)
没收到码想换号时可取消,未收码会自动退款:
curl -X POST https://api.simsmsbox.com/api/sms/orders/19/cancel \
-H "X-API-Key: psk_xxxxxxxx"
下一步
- 学习如何自动轮询:自动取号与轮询
- 学习模板化取码:自定义取码 URL 与模板化返回