请求头信息:
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Accept: application/json
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
to | string | 是 | 收件人邮箱地址 |
subject | string | 是 | 邮件主题 |
body | string | 是 | 邮件正文(批量发送模式) |
template_id | string | 否 | 邮件模板ID |
curl -X POST "https://cross.cybermagi.space/api/v1/email" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to": "customer@example.com", "subject": "订单确认通知", "body": "您的订单已确认,感谢您的购买!"}'
# Python调用示例
import requests
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://cross.cybermagi.space"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
data = {
"target": "batch"
}
response = requests.post(
f"{BASE_URL}/api/v1/email",
json=data,
headers=headers
)
result = response.json()
print(result)
{
"success": true,
"data": {
"message_id": "msg_batch_eccbc87e",
"status": "sent",
"to": "customer@example.com",
"sent_at": "2026-07-17T08:00:00Z"
},
"request_id": "req_email_batch_zh_3"
}
点击返回主页,获取API密钥并在线测试