mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-09-05 23:47:50 +08:00
feature: add /user_api/mails with filter params address and keyword (#639)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# 查看邮件 API
|
||||
|
||||
## 通过 HTTP API 查看邮件
|
||||
## 通过 邮件 API 查看邮件
|
||||
|
||||
这是一个 `python` 的例子,使用 `requests` 库查看邮件。
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
limit = 10
|
||||
offset = 0
|
||||
res = requests.get(
|
||||
f"http://localhost:8787/api/mails?limit={limit}&offset={offset}",
|
||||
f"https://<你的worker地址>/api/mails?limit={limit}&offset={offset}",
|
||||
headers={
|
||||
"Authorization": f"Bearer {你的JWT密码}",
|
||||
# "x-custom-auth": "<你的网站密码>", # 如果启用了自定义密码
|
||||
@@ -16,3 +16,51 @@ res = requests.get(
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
## admin 邮件 API
|
||||
|
||||
支持 `address` filter 和 `keyword` filter
|
||||
|
||||
```python
|
||||
import requests
|
||||
|
||||
url = "https://<你的worker地址>/admin/mails"
|
||||
|
||||
querystring = {
|
||||
"limit":"20",
|
||||
"offset":"0",
|
||||
# adress 和 keyword 为可选参数
|
||||
"address":"xxxx@awsl.uk",
|
||||
"keyword":"xxxx"
|
||||
}
|
||||
|
||||
headers = {"x-admin-auth": "<你的Admin密码>"}
|
||||
|
||||
response = requests.get(url, headers=headers, params=querystring)
|
||||
|
||||
print(response.json())
|
||||
```
|
||||
|
||||
## user 邮件 API
|
||||
|
||||
支持 `address` filter 和 `keyword` filter
|
||||
|
||||
```python
|
||||
import requests
|
||||
|
||||
url = "https://<你的worker地址>/user_api/mails"
|
||||
|
||||
querystring = {
|
||||
"limit":"20",
|
||||
"offset":"0",
|
||||
# adress 和 keyword 为可选参数
|
||||
"address":"xxxx@awsl.uk",
|
||||
"keyword":"xxxx"
|
||||
}
|
||||
|
||||
headers = {"x-admin-auth": "<你的Admin密码>"}
|
||||
|
||||
response = requests.get(url, headers=headers, params=querystring)
|
||||
|
||||
print(response.json())
|
||||
```
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "temp-mail-docs",
|
||||
"private": true,
|
||||
"version": "0.9.1",
|
||||
"version": "0.10.9",
|
||||
"type": "module",
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.14.1",
|
||||
"vitepress": "^1.6.3",
|
||||
"wrangler": "^4.10.0"
|
||||
"wrangler": "^4.13.0"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "vitepress dev docs",
|
||||
|
||||
Generated
+289
-289
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user