1. API Lấy Danh Sách Domain Hỗ Trợ
GET /api/domains
Trả về danh sách domain mà Token hiện tại được Admin cấp quyền sử dụng để tạo email.
curl "https://api.haiphongdeveloper.com/api/domains?token=<YOUR_TOKEN_HERE>"
Có thể truyền Token bằng Header thay cho query parameter:
curl https://api.haiphongdeveloper.com/api/domains \
-H "Authorization: Bearer <YOUR_TOKEN_HERE>"
Response mẫu:
{
"status": "success",
"domains": [
"haiphongdeveloper.com",
"nsu.vn"
]
}
2. API Tạo Email Tự Động (POST /api)
POST /api
Chỉ cần gửi kèm Token, API sẽ tự động tạo email ngẫu nhiên tự nhiên (không trùng) và tạo mật khẩu bảo mật ngẫu nhiên.
curl -X POST https://api.haiphongdeveloper.com/api -H "Content-Type: application/json" -d '{
"token": ""
}'
Response mẫu (Chỉ trả về email & mật khẩu):
{
"email": "dinh.phamdat44@haiphongdeveloper.com",
"password": "z@$#6iZ^AM%D"
}
3. API Đọc Email Mới Nhất & Chờ 30s (POST /api/read_email)
POST /api/read_email
Truyền email cần đọc và `timeout` (tối đa 30s). API sẽ tự động lắng nghe và trả kết quả ngay khi email mới cập bến.
curl -X POST https://api.haiphongdeveloper.com/api/read_email -H "Content-Type: application/json" -d '{
"token": "",
"email": "dinh.phamdat44@haiphongdeveloper.com",
"timeout": 30
}'
Response mẫu (Bao gồm nội dung email & mã OTP):
{
"status": "success",
"is_new": true,
"email": "dinh.phamdat44@haiphongdeveloper.com",
"from": ""Support" ",
"subject": "Verification Code 889922",
"date": "2026-07-25T03:05:08.000Z",
"text": "Ma xac thuc dang nhap cua ban la: 889922",
"code": "889922"
}