mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-08-28 19:48:01 +08:00
feat: docs: add new-address-api (#309)
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
# 新建邮箱地址 API
|
||||
|
||||
## 通过 admin API 新建邮箱地址
|
||||
|
||||
这是一个 `python` 的例子,使用 `requests` 库发送邮件。
|
||||
|
||||
```python
|
||||
res = requests.post(
|
||||
# 替换 xxxx.xxxx 为你的 worker 域名
|
||||
"https://xxxx.xxxx/admin/new_address",
|
||||
json={
|
||||
# 是否启用前缀 (True/False)
|
||||
"enablePrefix": True,
|
||||
"name": "<邮箱名称>",
|
||||
"domain": "<邮箱域名>",
|
||||
},
|
||||
headers={
|
||||
'x-admin-auth': "<你的网站admin密码>",
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
)
|
||||
|
||||
# 返回值 {"jwt": "<Jwt>"}
|
||||
print(res.json())
|
||||
```
|
||||
Reference in New Issue
Block a user