1. 獲取帳戶餘額 (Get Balance)
通過 API Key 獲取當前帳戶的餘額信息。
GET /api/client/me?api_key={YOUR_API_KEY}
{"api_key": "sk-...", "balance": 15.5, "is_admin": false}
2. 獲取項目列表 (Get Projects)
獲取系統當前可用的業務項目及價格套餐 (Pricing Index 從 0 開始計算)。
GET /api/client/projects
[{"id": 1, "name": "WhatsApp", "pricing": [{"label": "5分鐘", "minutes": 5, "price": 0.1}], "stock": 120}]
3. 購買獲取號碼 (Get Number)
使用 API Key 和指定的項目 ID 購買號碼。
POST /api/client/get_number
請求 Body (JSON):
{"api_key": "sk-...", "project_id": 1, "pricing_index": 0}
成功響應 (保留 order_id 提取短信):
{"code": 0, "data": {"order_id": 99, "phone_number": "66812345678"}}
4. 獲取短信內容 (Get SMS)
通過上一步獲取的 order_id 輪詢提取短信(建議每隔 3-5 秒請求一次)。
GET /api/client/get_sms/{order_id}?api_key={YOUR_API_KEY}
{"status": "Success", "sms_code": "123456", "full_sms_content": "Your code is 123456", "phone": "66812345678"}
1. Get Account Balance
Get the balance of the current account using the API Key.
GET /api/client/me?api_key={YOUR_API_KEY}
{"api_key": "sk-...", "balance": 15.5, "is_admin": false}
2. Get Projects List
Get available service projects and pricing packages (Pricing Index starts at 0).
GET /api/client/projects
[{"id": 1, "name": "WhatsApp", "pricing": [{"label": "5 Mins", "minutes": 5, "price": 0.1}], "stock": 120}]
3. Purchase Number
Use API Key and Project ID to buy a number.
POST /api/client/get_number
Request Body (JSON):
{"api_key": "sk-...", "project_id": 1, "pricing_index": 0}
Success Response (Save order_id for SMS):
{"code": 0, "data": {"order_id": 99, "phone_number": "66812345678"}}
4. Get SMS Content
Poll for SMS using the order_id (Poll every 3-5 seconds).
GET /api/client/get_sms/{order_id}?api_key={YOUR_API_KEY}
{"status": "Success", "sms_code": "123456", "full_sms_content": "Your code is 123456", "phone": "66812345678"}