Introduction
BizMail Delivery API — Overview
🇬🇧 English
Introduction
BizMail provides two methods to send transactional emails from your application:
- REST API — Send emails via HTTP requests using JWT authentication
- SMTP — Send emails via standard SMTP protocol using your BizMail Portal credentials
All credentials (username, password) are managed through the BizMail Portal.
REST API
Base URL: https://smtp-api.bizfly.vn
Authentication Flow
BizMail API uses JWT (JSON Web Token) for authentication.
JavaScript
Python
Java
cURL
Shell
Endpoints
1. Auth — Get Token
POST /api/1.0/auth/token
Obtain a JWT access token and refresh token using credentials from BizMail Portal.
Request Body (JSON):
Response:
JavaScript
Python
Java
cURL
Shell
2. Auth — Refresh Token
POST /api/1.0/auth/refresh
Get a new access token and refresh token using an existing refresh token.
Request Body (JSON):
Response:
JavaScript
Python
Java
cURL
Shell
3. Send Mail
POST /api/1.0/mail/store
Send a transactional email with optional attachments.
Headers: Authorization: Bearer , Content-Type: multipart/form-data
Key Fields:
* At least one of
textorhtmlis required.
Response:
JavaScript
Python
Java
cURL
Shell
4. Webhook — Mail Tracking
BizMail pushes real-time delivery events to your configured webhook URL set in the BizMail Portal.
Trigger events:
Configure your webhook URL in the BizMail Portal under your account settings. See the Webhook Tracking document for full payload details.
Configure your webhook URL in the BizMail Portal under your account settings.
SMTP
For applications that support SMTP natively (e.g. Laravel Mail, PHPMailer, Nodemailer), you can send emails directly via BizMail’s SMTP server.
SMTP Configuration
Example — Laravel (.env)
JavaScript
Python
Java
cURL
Shell
Example — PHPMailer
JavaScript
Python
Java
cURL
Shell
Example — Nodemailer
JavaScript
Python
Java
cURL
Shell
🇻🇳 Tiếng Việt
Giới thiệu
BizMail cung cấp hai phương thức gửi email giao dịch từ ứng dụng của bạn:
- REST API — Gửi email qua HTTP request sử dụng xác thực JWT
- SMTP — Gửi email qua giao thức SMTP chuẩn sử dụng thông tin đăng nhập từ BizMail Portal
Tất cả thông tin đăng nhập (username, password) được quản lý qua BizMail Portal.
REST API
Base URL: https://smtp-api.bizfly.vn
Luồng xác thực
BizMail API sử dụng JWT (JSON Web Token) để xác thực.
JavaScript
Python
Java
cURL
Shell
Danh sách Endpoint
1. Auth — Lấy Token
POST /api/1.0/auth/token
Lấy JWT access token và refresh token từ thông tin đăng nhập trên BizMail Portal.
Request Body (JSON):
Response:
JavaScript
Python
Java
cURL
Shell
2. Auth — Refresh Token
POST /api/1.0/auth/refresh
Lấy access token và refresh token mới từ refresh token hiện có.
Request Body (JSON):
Response:
JavaScript
Python
Java
cURL
Shell
3. Gửi Mail
POST /api/1.0/mail/store
Gửi email giao dịch, hỗ trợ file đính kèm.
Headers: Authorization: Bearer , Content-Type: multipart/form-data
Các tham số chính:
* Phải có ít nhất một trong
texthoặchtml.
Response:
JavaScript
Python
Java
cURL
Shell
4. Webhook — Tracking Mail
BizMail gửi các sự kiện tracking theo thời gian thực đến webhook URL được cấu hình trong BizMail Portal.
Các sự kiện:
Cấu hình webhook URL trong BizMail Portal tại phần cài đặt tài khoản. Xem chi tiết payload tại tài liệu Webhook Tracking.
SMTP
Dành cho các ứng dụng hỗ trợ SMTP gốc (Laravel Mail, PHPMailer, Nodemailer…), bạn có thể gửi email trực tiếp qua SMTP server của BizMail.