POST/numbers
领取一个号码
为一个国家中的一个应用购买一个全新的虚拟号码。费用会立即从您的余额中扣除。号码起始状态为 waiting。在应用中输入它,然后轮询验证码。
app服务标识,例如 telegram、whatsapp、openai。
country两字母国家代码,例如 us、gb、in。
请求
curl -s https://coingite.com/api/v1/numbers \
-H "Authorization: Bearer $COINGITE_KEY" \
-d app=telegram -d country=us
响应 201
{
"id": "num_8fK2a1",
"number": "+14155550199",
"status": "waiting",
"app": "telegram",
"country": "us",
"price": 0.45
}
GET/numbers/{id}
轮询验证码
返回一个号码的当前状态。当状态为 waiting 时,每隔几秒轮询一次。短信到达时,状态变为 received 且 code 中包含数字。20 分钟后仍无验证码时,状态为 expired,费用会退回您的余额。
请求
curl -s https://coingite.com/api/v1/numbers/num_8fK2a1 \
-H "Authorization: Bearer $COINGITE_KEY"
响应 200
{
"id": "num_8fK2a1",
"status": "received",
"code": "48391",
"number": "+14155550199"
}
DELETE/numbers/{id}
取消一个号码
取消一个仍处于 waiting 状态的号码,并将其费用退回您的余额。一旦收到验证码,该号码便无法再取消。
请求
curl -s -X DELETE \
https://coingite.com/api/v1/numbers/num_8fK2a1 \
-H "Authorization: Bearer $COINGITE_KEY"
响应 200
{
"id": "num_8fK2a1",
"status": "cancelled",
"refunded": 0.45
}
GET/prices
列出价格
列出某个应用可用的每个国家,按最便宜在前排列,含每条验证码的价格以及当前有多少个号码有库存。可用它在领取前选择一个国家。
请求
curl -s "https://coingite.com/api/v1/prices?app=telegram" \
-H "Authorization: Bearer $COINGITE_KEY"
响应 200
[
{ "country": "ru", "price": 0.28, "stock": 1842 },
{ "country": "in", "price": 0.33, "stock": 517 },
{ "country": "us", "price": 0.45, "stock": 96 }
]
GET/balance
查询余额
以美元返回您账户上剩余的资金。在批量领取号码前查询它,可避免任务中途卡住。
请求
curl -s https://coingite.com/api/v1/balance \
-H "Authorization: Bearer $COINGITE_KEY"
响应 200
{
"balance": 42.15
}