作者:Chancel Yang, 创建:2023-07-18, 字数:3555, 已阅:77, 最后更新:2023-09-22
以下会涉及到一些博客的API接口,仅提供开发和测试调用
出于博客程序版本更新可能导致的BUG,我不建议将博客的API接口用于生产环境
考虑到安全性问题,对于一些敏感的API调用(例如涉及资源消耗的操作),会限制单位时间内的请求次数。
API接口会不定期进行更新,如果发现API有请求方面的问题欢迎随时留言告知
服务: relay://www.chancel.me:2206/?id=ZY73TOU-DLR4KHS-TMQTTTP-QG22MQX-XY4PBUO-GX3OLFD-DGQT6RY-HRV37A5
syncthing是一款非常好用的p2p同步软件,但国内复杂的NAT网络偶尔导致同步文件很慢,借助上面的中继服务器可以实现稳定的文件同步
使用方法
relay://[domain:port]/?id=[id]
如图
地址:https://gravatar.chancel.me/avatar
使用方法
地址:https://plantuml.chancel.me
使用方法
搭建文档参考: plantuml/plantuml-server - github.com
地址:https://api.chancel.me/rest/api/v1/image
请求方法:GET
接口说明:用于获取随机webp图片,尺寸是1920x1080,支持自定义宽度或者高度,图片来源网络不做内容保证
请求参数
参数名称 | 参数类型 | 是否必须 | 说明 |
---|---|---|---|
id | string | 否 | 指定ID可每次获取相同图片 |
height | int | 否 | 指定高度(宽度根据图片自适应) |
width | int | 否 | 指定宽度(高度根据图片自适应) |
返回参数
二进制图片内容
地址:https://api.chancel.me/rest/api/v1/ip
请求方法:GET
接口说明:返回调用者的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
}
地址:https://api.chancel.me/rest/api/v1/telegram
请求方法:POST
接口说明:由于众所周知的问题,导致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"
}
}