对于开发者

这一部分是API文档,用于将您的服务与SMS-Man和自动购买号码连接起来。

租用API

API是你的软件和我们的号码租赁服务器之间的通信协议

API端口描述

所有的请求必须进入https://api.sms-man.com/rent-api/GET请求。 所有的请求中必须要包含API密钥参数token所有的响应结果为json格式。

查询余额请求

https://api.sms-man.com/rent-api/get-balance?token=$token

参数

参数 类型 需要 价值
token 线路 您的API密钥

结果

{"balance":"799.70"}

可能的错误

{"success":false,"error_code":"wrong_token","error_msg": "token": "Wrong token!"}

获取所有国家的列表

https://api.sms-man.com/rent-api/limits?token=$token&country_id=$country_id&type=$type&time=$time

参数

参数 类型 需要 价值
token 线路 您的API密钥
country_id Integer
国家号码
type 线路 小时/日/周/月
time 线路 租用时间

结果

{"type":"hour","time":"4","limits":[{"country_id":"1","count":"127","cost":"151.68"},{"country_id":"2","count":"49","cost":"113.56"},{"country_id":"4","count":"0","cost":"151.68"}]}

可能的错误

{"success":false,"error_code":"wrong_token","error_msg": {"token": "Wrong token!"}}

请求租号

https://api.sms-man.com/rent-api/get-number?token=$token&country_id=$country_id&type=$type&time=$time

参数

参数 类型 需要 价值
token 线路 您的API密钥
country_id Integer 不可以
国家号码
type 线路 小时/日/周/月
time 线路 租用时间

结果

{"request_id":1,"country_id":1,"number":"79002415539"}

可能的错误

{{"success":false,"error_code":"wrong_token","error_msg": "token": "Wrong token!"}

订购部分号码进行租用

https://api.sms-man.com/rent-api/get-number?token=$token&country_id=$country_id&type=$type&time=$time&application_id=$application_id&partial=1

参数

参数 类型 需要 价值
token 线路 您的API密钥
country_id Integer 不可以
国家号码
application_id Integer
号码服务
type 线路 小时/日/周/月
time 线路 租用时间

结果

{"request_id":1,"country_id":1,"application_id":1,"number":"79002415539"}

可能的错误

{{"success":false,"error_code":"wrong_token","error_msg": "token": "Wrong token!"}

变化 状态

https://api.sms-man.com/rent-api/set-status?token=$token&request_id=$request_id&status=$status

参数

参数 类型 需要 价值
token 线路 您的API密钥
request_id Integer 要求ID
状态 线路 取消 - 取消租用(在20分钟内如果号码没有收到短信)/ 关闭 - 停止租用

结果

{"request_id": 1, "success": true}

可能的错误

{"success":false,"error_code":"wrong_token","error_msg": "token": "Wrong token!"}

接收最新短信

https://api.sms-man.com/rent-api/get-sms?token=$token&request_id=$request_id

参数

参数 类型 需要 价值
token 线路 您的API密钥
request_id Integer 要求ID

结果

{"request_id":"10","country_id":1,"number":"79633002801","sms": {"message":"message", "code": "code", "time": "2020-12-12 14:50:31"}}

可能的错误

{"success":false,"error_code":"wrong_token","error_msg": "token": "Wrong token!"}

接收 所有短信

https://api.sms-man.com/rent-api/get-all-sms?token=$token&request_id=$request_id

参数

参数 类型 需要 价值
token 线路 您的API密钥
request_id Integer 要求ID

结果

{"request_id":"10","country_id":1,"number":"79633002801","sms": [{"message":"message", "code": "code", "time": "2020-12-12 14:50:31"}]}

可能的错误

{"success":false,"error_code":"wrong_token","error_msg": "token": "Wrong token!"}

获取所有号码的列表

https://api.sms-man.com/rent-api/get-all-requests?token=$token

参数

参数 类型 需要 价值
token 线路 Your API KEY

结果

[{"id":1,"country_id":1,"number":"79002415539","status":"cancel"}]

可能的错误

{"success":false,"error_code":"wrong_token","error_msg": "token": "Wrong token!"}
{{country.title}}
{{country.id}}
logo {{service.title}}
{{service.id}}
×
接受