API 接口文档
1. 文件上传 (api_upload)
第三方程序调用上传图片或视频到 TG 群组
POST
/index.php?act=api_upload
Headers
| 参数 | 说明 |
|---|---|
| X-Api-Key | 后台配置的第三方 API 密钥 |
Body (multipart/form-data)
| 参数 | 类型 | 说明 |
|---|---|---|
| file | File | 上传的文件,必填 |
| filename | string | 自定义文件名,可选 |
| api_key | string | API密钥(可选header传递) |
响应示例
{
"code": 200,
"msg": "上传成功",
"data": {
"link": "https://domain/zl/photos/xxx.jpg",
"filename": "test.jpg",
"fileId": "xxx",
"msgId": 123
}
}
2. 发送文字 (sendTextApi)
通过 API 发送文字消息到 TG 群组
POST
/index.php?act=sendTextApi
Headers
| 参数 | 说明 |
|---|---|
| X-Api-Key | 后台配置的第三方 API 密钥 |
Body
| 参数 | 类型 | 说明 |
|---|---|---|
| text | string | 消息内容,必填 |
| api_key | string | API密钥(可选header传递) |
3. 媒体访问
通过代理访问 TG 群组中的媒体文件
GET
/zl/{file_path}
参数
| 参数 | 说明 |
|---|---|
| path | TG getFile 接口返回的文件路径 |
错误码说明
| code | 说明 |
|---|---|
| 200 | 成功 |
| 400 | 请求参数错误 |
| 401 | API密钥错误 |
| 500 | 服务器错误,TG接口调用失败 |