-
Notifications
You must be signed in to change notification settings - Fork 146
后端接口文档
服务探活
/api/ping
POST/GET
不适用
text
curl localhost/api/ping
pong
登陆
/api/login
POST
Content-type:application/json
JSON
参数名 | 类型 | 说明 |
---|---|---|
account | string | 账号 |
password | string | 密码 |
curl -XPOST -H 'Content-type:application/json' -d '{"account":"admin","password":"admin"}'
{
"errorNo": 0,
"errorMsg": "",
"data": ""
}
获取邮件组信息
/api/group
POST/GET
any
JSON
curl -XPOST localhost/api/group
{
"errorNo": 0,
"errorMsg": "",
"data": [
{
"label": "All Email",
"tag": "",
"children": [
{
"label": "Inbox",
"tag": "{\"type\":0,\"status\":-1}",
"children": null
},
{
"label": "Outbox",
"tag": "{\"type\":1,\"status\":1}",
"children": null
},
{
"label": "Sketch",
"tag": "{\"type\":1,\"status\":0}",
"children": null
}
]
}
]
}
获取邮件列表
/api/email/list
POST
Content-type:application/json
JSON
参数名 | 类型 | 说明 |
---|---|---|
keyword | string | 搜索关键词 |
tag | string | 邮件筛选tag |
current_page | int | 当前页数 |
page_size | int | 每页数量 |
curl -XPOST -H 'Content-type:application/json' -d '{"keyword":"验证码"}'
{
"errorNo": 0,
"errorMsg": "",
"data": {
"current_page": 0,
"total_page": 1,
"list": [
{
"id": 1,
"title": "This is email title",
"desc": "This is desc",
"datetime": "2023-08-07 08:44:00",
"is_read": true,
"sender": {
"Name": "",
"EmailAddress": "<test@xxxx.com>"
}
}
]
}
}
获取邮件详情
/api/detail
POST
Content-type:application/json
JSON
参数名 | 类型 | 说明 |
---|---|---|
id | int | 邮件ID |
curl -XPOST -H 'Content-type:application/json' -d '{"id":1}'
{
"errorNo": 0,
"errorMsg": "",
"data": {
"id": 1,
"type": 0,
"subject": "xxxx",
"reply_to": "null",
"from_name": "",
"from_address": "<test@xxxx.com>",
"to": "[{\"Name\": \"\", \"EmailAddress\": \"<jxxxxe@xxx.com>\"}]",
"bcc": "null",
"cc": "null",
"sender": "{\"Name\": \"\", \"EmailAddress\": \"<test@xxx.com>\"}",
"spf_check": 1,
"dkim_check": 1,
"status": 0,
"cron_send_time": "2023-08-07T23:44:01+08:00",
"send_user_id": 0,
"is_read": 1,
"send_time": "2023-08-07 23:44:01",
"send_date": "2023-08-07 08:44:00",
"update_time": "2023-08-08 07:54:35",
"create_time": "2023-08-07 23:44:01",
"text": "xxxxx",
"html": "<div>xxxxx</div>",
"error": "",
"attachments": []
}
}
发送邮件
/api/email/send
POST
Content-type:application/json
JSON
curl -XPOST localhost/api/email/send -d
'{
"from": {
"name": "i",
"email": "i@xxx.com"
},
"to": [
{
"name": "xx",
"email": "ok@xxxx.com"
},
{
"name": "xx",
"email": "xx@xx.com"
}
],
"cc": [
],
"subject": "Title",
"text": "text",
"html": "<div>text</div>",
"attrs": [
{
"name": "xxx.file",
"data": "data:text/plain;base64,dxxxxxxxxxxxxxxx"
}
]
}'
{
"errorNo": 0,
"errorMsg": "",
"data": ""
}
修改账号密码
/api/settings/modify_password
POST
Content-type:application/json
JSON
参数名 | 类型 | 说明 |
---|---|---|
password | string | 新密码 |
curl -XPOST -H 'Content-type:application/json' -d '{"passowrd":"xxx"}'
获取某个邮件的某个附件
/attachments/
POST
Content-type:application/json
``
curl -XGET localhost/attachments/{{邮件id}}/{{附件id}}
下载某个附件
/attachments/download/
GET
``
文件
curl -XGET loaclhost/attachments/download/{{邮件id}}/{{附件id}}
文件