1. ping
说明
服务探活
请求地址
/api/ping
请求方式
POST/GET
请求格式
不适用
返回格式
text
请求示例
curl localhost/api/ping
返回示例
pong
2. login
说明
登陆
请求地址
/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": ""
}
3. group
说明
获取邮件组信息
请求地址
/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
}
]
}
]
}
4. email/list
说明
获取邮件列表
请求地址
/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>"
}
}
]
}
}
5. email/detail
说明
获取邮件详情
请求地址
/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": []
}
}
6. email/send
说明
发送邮件
请求地址
/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": ""
}
7. settings/modify_password
说明
修改账号密码
请求地址
/api/settings/modify_password
请求方式
POST
请求格式
Content-type:application/json
返回格式
JSON
请求参数
参数名 | 类型 | 说明 |
---|---|---|
password | string | 新密码 |
请求示例
curl -XPOST -H 'Content-type:application/json' -d '{"passowrd":"xxx"}'
返回示例
8. attachments
说明
获取某个邮件的某个附件
请求地址
/attachments/
请求方式
POST
请求格式
Content-type:application/json
返回格式
``
请求示例
curl -XGET localhost/attachments/{{邮件id}}/{{附件id}}
返回示例
9. attachments/download
说明
下载某个附件
请求地址
/attachments/download/
请求方式
GET
请求格式
``
返回格式
文件
请求示例
curl -XGET loaclhost/attachments/download/{{邮件id}}/{{附件id}}
返回示例
文件