基础 URL: http://93.127.139.192:45679/api/v1
认证方式: 在每个请求的 HTTP 请求头 (Header) 中添加 Authorization: Bearer YOUR_API_KEY。API Key 请登录您的 Bulk Mail Hub 账户在 "API 设置" 页面获取。
GET /domains
描述: 获取当前用户账户下所有已添加的域名列表。
响应 (成功 - 200 OK):
[
{"name": "domain1.com"},
{"name": "domain2.net"}
]
响应 (失败): 401 Unauthorized (Key 无效), 500 Internal Server Error
POST /domains
描述: 将一个或多个域名批量添加到当前用户的账户下。
请求体 (JSON):
{
"domains": ["newdomain1.com", "newdomain2.org"]
}
domains (array[string], 必需): 包含一个或多个域名的数组。响应 (成功 - 200 OK): 返回每条记录的处理结果。
[
{"domain": "newdomain1.com", "status": "success"},
{"domain": "newdomain2.org", "status": "skipped", "details": "Domain already exists for this user."},
{"domain": "faileddomain.com", "status": "failed", "details": {"error": "API request failed", "details": "..."}}
]
响应 (失败): 400 Bad Request (缺少 `domains` 字段或格式错误), 401 Unauthorized, 500 Internal Server Error
GET /emails
描述: 获取当前用户账户下所有域名的邮箱列表。
响应 (成功 - 200 OK):
[
{"id": 1, "email": "user1@domain1.com"},
{"id": 2, "email": "support@domain2.net"}
]
响应 (失败): 401 Unauthorized, 500 Internal Server Error
POST /emails/generate-random
描述: 在用户指定的一个或多个域名下,批量生成指定数量的随机前缀邮箱。
请求体 (JSON):
{
"domains": ["domain1.com", "domain2.net"],
"count": 5
}
domains (array[string], 必需): 在哪些域名下生成。用户必须拥有这些域名。count (integer, 必需): 要生成的邮箱数量。响应 (成功 - 200 OK): 返回每个生成操作的结果,包含邮箱地址和密码(如果成功)。
[
{"email": "abc123de@domain1.com", "password": "GeneratedPassword1", "status": "success", "details": {}},
{"email": "xyz789fg@domain2.net", "password": "GeneratedPassword2", "status": "success", "details": {}},
{"email": "failed@domain1.com", "password": null, "status": "failed", "details": {"error": "..."}}
]
响应 (失败): 400 Bad Request (参数缺失或无效), 401 Unauthorized, 403 Forbidden (用户不拥有指定域名), 500 Internal Server Error
POST /emails/generate-specific
描述: 在用户指定的单个域名下,为提供的一系列前缀生成邮箱。
请求体 (JSON):
{
"domain": "domain1.com",
"prefixes": ["admin", "support", "sales"]
}
domain (string, 必需): 在哪个域名下生成。用户必须拥有该域名。prefixes (array[string], 必需): 要使用的邮箱前缀列表。响应 (成功 - 200 OK): 返回每个生成操作的结果。
[
{"email": "admin@domain1.com", "password": "GeneratedPassword3", "status": "success", "details": {}},
{"email": "support@domain1.com", "password": "GeneratedPassword4", "status": "success", "details": {}},
{"email": "sales@domain1.com", "password": null, "status": "failed", "details": {"error": "Account already exists."}}
]
响应 (失败): 400 Bad Request, 401 Unauthorized, 403 Forbidden, 500 Internal Server Error
POST /inbox/fetch
描述: 登录用户提供的多个邮箱账户,根据指定类型提取信息(最新邮件、验证码、链接或关键词搜索)。
请求体 (JSON):
{
"accounts": [
{"email": "user1@domain.com", "password": "password123"},
{"email": "user2@domain.com", "password": "password456"}
],
"extract_type": "code",
"keyword": null
}
accounts (array[object], 必需): 包含邮箱和密码的对象数组。注意:通过 API 传递密码存在安全风险,请确保您的客户端安全。extract_type (string, 必需): 操作类型。可选值: "latest_email", "code", "link", "keyword"。keyword (string, 可选): 当 extract_type 为 "keyword" 时必需。响应 (成功 - 200 OK): 返回一个包含所有处理结果的数组。
[
{"from": "...", "to": "user1@domain.com", "subject": "...", "body_preview": "...", "extracted_content": "123456"},
{"from": "...", "to": "user2@domain.com", "subject": "包含<mark>关键词</mark>的主题", "body_preview": "...", "extracted_content": ""},
{"error": "Failed to process user3@domain.com: Authentication failed"}
]
响应 (失败): 400 Bad Request (参数错误), 401 Unauthorized, 500 Internal Server Error
POST /emails/send-bulk
描述: 提交一个后台异步的批量发送任务。
请求体 (JSON):
{
"senders": "sender1@your-domain.com\nsender2@your-domain.com",
"recipients": "email,name\nuser1@example.com,Alice\nuser2@example.com,Bob",
"subject": "你好 {name}",
"body": "<p>这是邮件内容, {name}。</p>",
"interval": 5
}
senders (string, 必需): 发件人邮箱列表,每行一个。recipients (string, 必需): CSV 格式的字符串。第一行必须是表头,且必须包含 email 列。subject (string, 必需): 邮件主题,可使用 {header} 变量。body (string, 必需): HTML 邮件正文,可使用 {header} 变量。interval (integer, 可选, 默认 5): 发送间隔(秒)。响应 (成功 - 202 Accepted): 表示任务已提交到后台。
{
"message": "任务已成功提交!系统将在后台处理 2 个收件人。"
}
响应 (失败): 400 Bad Request, 401 Unauthorized, 500 Internal Server Error
注意: 这是一个异步操作。API 仅返回提交结果,不代表邮件已发送完成。