API 参考

开发者 API 参考

本 API 文档为开发者和集成商提供实现 SMS 验证服务所需的一切。所有响应均为 JSON 格式。

注意: 本参考面向 API 用户(开发者和集成商)。每个端点包含说明、身份验证要求、示例请求和响应。

身份验证

所有端点需要在 Authorization 头中使用 Bearer 令牌。

如何获取 API 密钥
  1. 登录 Proxnum 账户并前往您的 个人资料页面
  2. 滚动到“API 密钥管理”部分
  3. 点击“创建 API 密钥”生成新密钥
  4. 复制显示的 API 令牌

在每次请求中包含 API 令牌:

Authorization: Bearer YOUR_API_TOKEN_HERE
Accept: application/json
Content-Type: application/json

快速链接:

通用响应格式

错误使用标准化结构,便于集成按 code 处理。所有错误响应遵循此模式:

{
  "success": false,
  "code": "no_numbers",
  "message": "No numbers available for the selected service and country"
}

端点

GET /api/v1/resell/price?service=&country=

获取指定服务和国家的基础价与售价。下单前可用于估算费用。

参数(查询): service (string), country (int)

示例请求:

curl -s -X GET "https://proxnum.com/api/v1/resell/price?service=ig&country=6" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"

成功响应:

{
  "country": "6",
  "service": "ig",
  "base_price": 0.0334,
  "sell_price": 0.1114892
}

GET /api/v1/prices

获取所有可用服务和国家的完整定价。返回所有组合的基础价和经销商售价。

参数(查询,可选):

  • service service(字符串)- 按服务代码筛选(如 ig、wa、tg)
  • country country(整数)- 按国家代码筛选

示例请求(全部价格):

curl -s -X GET "https://proxnum.com/api/v1/prices" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"

示例请求(按国家筛选):

curl -s -X GET "https://proxnum.com/api/v1/prices?country=6" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"

成功响应(按国家筛选):

{
  "success": true,
  "prices": {
    "6": {
      "ig": {
        "base_price": 0.0334,
        "sell_price": 0.1114892,
        "available": 245
      },
      "wa": {
        "base_price": 0.0389,
        "sell_price": 0.1298737,
        "available": 189
      },
      "tg": {
        "base_price": 0.0223,
        "sell_price": 0.0744551,
        "available": 521
      },
      "go": {
        "base_price": 0.0278,
        "sell_price": 0.0928206,
        "available": 312
      }
    }
  }
}

注意: 响应为嵌套对象:第一层键为国家代码,第二层键为服务代码。每项服务包含 base_price(成本)、sell_price(经销商售价)和 available(可用号码数量,未知时为 null)。


POST /api/v1/resell/virtual/buy

购买临时(虚拟)号码。将尝试分配号码并从账户扣费。

请求体(JSON): {"service":"ig","country":6}

示例请求:

curl -s -X POST "https://proxnum.com/api/v1/resell/virtual/buy" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"service":"ig","country":6}'

成功响应(标准化):

{
  "success": true,
  "activation": {
    "id": 737,
    "phone": "62895406203932",
    "activation_id": "4390520873",
    "msg": "Waiting Sms",
    "date_created": "2025-11-08 21:50:34",
    "amount_paid": 0.111489,
    "status": 1
  }
}

常见错误代码:

{
  "success": false,
  "code": "no_numbers",
  "message": "No numbers available for this service in the selected country"
}

{
  "success": false,
  "code": "insufficient_balance",
  "message": "Not enough balance to place the order"
}

GET /api/v1/resell/virtual/{id}/status

检查激活状态。{id} 接受购买时返回的 activation id 字符串。

示例请求:

curl -s -X GET "https://proxnum.com/api/v1/resell/virtual/4390520873/status" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"

成功(验证码可用时):

{
  "success": true,
  "status": "completed",
  "code": "1234",
  "activation": { "id": 737, "phone": "628...", "activation_id": "4390520873" }
}

POST /api/v1/resell/virtual/resend

请求重发/重新激活。在请求体中使用 activation id 字符串。

请求体: {"activation_id":"4390520873"}

curl -s -X POST "https://proxnum.com/api/v1/resell/virtual/resend" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"activation_id":"4390520873"}'

响应(已接受):

{
  "success": true,
  "message": "Resend requested; new activation created",
  "activation": { "id": 738, "activation_id": "4390520874", "phone": "628..." }
}

POST /api/v1/resell/virtual/cancel

请求取消激活并退款。服务器评估是否可退款并返回标准化结果。

请求体: {"activation_id":"4390520873"}

curl -s -X POST "https://proxnum.com/api/v1/resell/virtual/cancel" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"activation_id":"4390520873"}'

已接受:

{
  "success": true,
  "code": "cancel_accepted",
  "message": "Cancellation accepted, refund processed"
}

已拒绝:

{
  "success": false,
  "code": "cancel_rejected",
  "message": "Cancellation rejected — activation already completed or not refundable"
}

GET /api/v1/resell/activations

列出已认证用户的激活记录(分页)。支持 page 和 per_page 查询参数。

curl -s -X GET "https://proxnum.com/api/v1/resell/activations?page=1&per_page=25" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"

实现说明

  • 尽可能使扣费操作按订单幂等;请检查返回的 order 或 transaction 字段获取标准标识符。
  • 下单前使用 price 端点试算费用。
  • 常见标准化错误代码:no_numbers、insufficient_balance、service_unavailable、cancel_rejected。
最佳实践:
  • 集成中始终处理成功和错误响应
  • 为网络超时实现适当的错误处理
  • 缓存国家和服务列表以减少 API 调用
  • 可用时使用 webhook 获取实时状态更新

chat us