我的API
服务说明
博客的API接口提供开发测试调用,往后提供的API也会往开发调试这方面靠,博客API会保证 稳定性。
博客的API接口不建议用于生产环境,因为博客程序会偶尔更新版本,虽然原则上已发布的API会 少改动,但万一我写出BUG呢(逃)。
出于对安全性考虑,对于部分敏感的API调用(如消耗资源类型)会限制单位时间内的请求次数。
API接口不定期更新,原则上会保证任何已经发布的API的信息不做删除,如需修改也会提前一定时间公布。
注:博客程序部署的域名已部署超过3年,请放心使用。
IP查询
GET
keyboard_arrow_down
https://api.chancel.me/rest/api/v1/ip
接口说明:返回调用者的IP
请求参数
参数名称 | 参数类型 | 是否必须 | 说明 |
---|---|---|---|
-- | -- | -- | -- |
返回参数
参数名称 | 参数类型 | 实例值 | 说明 |
---|---|---|---|
status | int | 0/1 | 处理结果,成功是1,错误是0 |
message | string | 查询IP成功 | 请求处理的消息 |
data | dict | - | 请求处理返回的数据(IP地址) |
CURL - 示例
curl https://api.chancel.me/rest/api/v1/ip
返回示例
{
"data":{
"ip":"173.242.127.92"
},
"message":"查询成功",
"status":1
}
Telegram代理请求
POST
keyboard_arrow_down
https://api.chancel.me/rest/api/v1/telegram
接口说明:由于众所周知的问题,导致Telegram的API无法正常调用,所以提供此API用于调用Telegram的消息机器人通知
请求参数
参数名称 | 参数类型 | 是否必须 | 说明 |
---|---|---|---|
apiKey | string | 是 | telegram bot key |
chatId | string | 是 | 接收消息的聊天人ID |
msgText | dict | 否 | 消息文本(默认采用MarkdownV2语法) |
返回参数
参数名称 | 参数类型 | 实例值 | 说明 |
---|---|---|---|
status | int | 0/1 | 处理结果,成功是1,错误是0 |
msg | string | - | 执行命令的消息文本 |
data | dict | - | 请求处理返回的数据(如成功则是Telegram返回的数据) |
CURL - 示例
curl -X POST -H "Content-Type:application/json" -d '{"apiKey":"2126564823:AdksmwskKm_BKGf8kKsjdxaGveuUHHKVx-Y","msgText":"hello","chatId":"793833844"}' https://api.chancel.me/rest/api/v1/telegram
返回示例
{
"status": 1,
"msg": "消息发送成功",
"data": {
"chat": {
"first_name": "chancel",
"id": 793833844,
"last_name": "shuai",
"type": "private",
"username": "chancel"
},
"date": 1638782848,
"from": {
"first_name": "MideaMsgBot",
"id": 2062029367,
"is_bot": true,
"username": "MideaMsgBot"
},
"message_id": 12,
"text": "hello"
}
}