POST/numbers
开通号码
为一个国家中的一个应用取出一个全新虚拟号码,并立即从你的余额中扣除价格。它以 waiting 状态开启:把它填入应用,然后轮询验证码。
app服务标识符,例如 telegram、whatsapp 或 openai。
country两位字母的国家代码,例如 us、gb 或 in。
请求
curl -s https://simlyra.com/api/v1/numbers \
-H "Authorization: Bearer $SIMLYRA_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 带上那串数字。二十分钟毫无动静则显示为 expired,而价格此时已退回你的余额。
请求
curl -s https://simlyra.com/api/v1/numbers/num_8fK2a1 \
-H "Authorization: Bearer $SIMLYRA_KEY"
响应 200
{
"id": "num_8fK2a1",
"status": "received",
"code": "48391",
"number": "+14155550199"
}
DELETE/numbers/{id}
取消号码
释放一个仍处于 waiting 状态的号码,并把其价格退回你的余额。一旦验证码已到达,号码便已结清,无法再取消。
请求
curl -s -X DELETE \
https://simlyra.com/api/v1/numbers/num_8fK2a1 \
-H "Authorization: Bearer $SIMLYRA_KEY"
响应 200
{
"id": "num_8fK2a1",
"status": "cancelled",
"refunded": 0.45
}
GET/prices
列出价格
遍历某应用可用的每个国家,由低到高排列,附上每条验证码的价格以及此刻有多少号码空闲。可据此在开通前确定一个国家。
app要查价的服务标识符,例如 telegram。
请求
curl -s "https://simlyra.com/api/v1/prices?app=telegram" \
-H "Authorization: Bearer $SIMLYRA_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://simlyra.com/api/v1/balance \
-H "Authorization: Bearer $SIMLYRA_KEY"
响应 200
{
"balance": 42.15
}