Quản lý Email
Quản lý Email: Danh sách, Tra cứu, Kiểm tra, Tài khoản, Quản lý
Tổng quan
Quản lý Email: Danh sách, Tra cứu, Kiểm tra, Tài khoản, Quản lý
- Danh sách: Danh sách gói Email
- Tra cứu: Chi tiết gói Email, Chi tiết nhóm Email, Lấy Email theo Domain ID
- Kiểm tra: Xác thực địa chỉ Email
- Tài khoản: Đồng bộ tài khoản Email, Tạo tài khoản Email, Xóa tài khoản Email
- Quản lý: Cập nhật ghi chú Email, Cập nhật nhóm Email, Cập nhật trạng thái xác minh
- Authentication: API key Bearer token qua header
Authorization: Bearer YOUR_API_KEY
Base URL: https://developers-dev.inet.vn/api/gateway/v1
Response wrapper: Tất cả response được wrap trong { success, data, meta }. Response schema bên dưới mô tả nội dung field data. Xem chi tiết tại Response Format.
Danh sách
Danh sách gói Email
GET /email
Lấy danh sách gói email của khách hàng, hỗ trợ phân trang và lọc.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
name | query | string | Không | Lọc theo tên (để trống = tất cả) |
status | query | string | Không | Lọc theo trạng thái (VD: active, trial, suspended) |
page | query | integer | Không | Số trang (bắt đầu từ 1) |
pageSize | query | integer | Không | Số bản ghi mỗi trang |
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://developers-dev.inet.vn/api/gateway/v1/email"Response
{
"size": 1,
"number": 1,
"content": [
{
"id": 1,
"note": "example_note",
"type": "example_type",
"status": "example_status",
"domainId": "example_domainId",
"planName": "Gói A",
"issueDate": "example_issueDate",
"domainName": "example_domainName",
"expireDate": "example_expireDate",
"gatewayDomainRelay": "example_gatewayDomainRelay",
"gatewayDomainTransport": "example_gatewayDomainTransport"
}
],
"totalPages": 1,
"totalElements": 1,
"numberOfElements": 1
}
| Trường | Kiểu | Mô tả |
|---|---|---|
size | integer | Kích thước trang |
number | integer | Số trang hiện tại (0-based) |
content | array | Danh sách gói email |
content[].id | integer | ID gói email |
content[].note | string | Ghi chú |
content[].type | string | Loại email: email-cloud, email-lite, email-forwarding |
content[].status | string | Trạng thái: active, trial, suspended, expired |
content[].domainId | string | UUID của domain tham chiếu |
content[].planName | string | Tên gói (VD: Gói A, Gói Lite, FREE) |
content[].issueDate | string | Ngày cấp (MM/dd/yyyy HH:mm) |
content[].domainName | string | Tên miền gắn email |
content[].expireDate | string | Ngày hết hạn (MM/dd/yyyy HH:mm) |
content[].gatewayDomainRelay | string | Tên miền xử lý email (Relay) |
content[].gatewayDomainTransport | string | Địa chỉ IP máy chủ xử lý email |
totalPages | integer | Tổng số trang |
totalElements | integer | Tổng số bản ghi |
numberOfElements | integer | Số phần tử trang hiện tại |
Tra cứu
Chi tiết gói Email
GET /email/{emailId}
Lấy thông tin chi tiết gói email theo ID.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
emailId | path | integer | Có | ID gói email |
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://developers-dev.inet.vn/api/gateway/v1/email/{emailId}"Response
{
"id": 1,
"note": "example_note",
"type": "example_type",
"status": "example_status",
"domainId": "example_domainId",
"planName": "Gói A",
"issueDate": "example_issueDate",
"dataExtend": "example_dataExtend",
"domainName": "example_domainName",
"expireDate": "example_expireDate",
"verifyStatus": "example_verifyStatus",
"gatewayDomainRelay": "example_gatewayDomainRelay",
"gatewayDomainTransport": "example_gatewayDomainTransport"
}
| Trường | Kiểu | Mô tả |
|---|---|---|
id | integer | ID gói email |
note | string | Ghi chú gói email |
type | string | Loại gói: email-cloud, email-lite... |
status | string | Trạng thái: active, trial, suspended, expired |
domainId | string | UUID của tên miền |
planName | string | Tên gói (VD: Gói A) |
issueDate | string | Ngày kích hoạt |
dataExtend | string | JSON string chứa thông tin mở rộng của gói email |
domainName | string | Tên miền gắn với gói email |
expireDate | string | Ngày hết hạn |
verifyStatus | string | Trạng thái xác minh DNS: verified, not-verify |
gatewayDomainRelay | string | Tên miền xử lý email (Relay) |
gatewayDomainTransport | string | Địa chỉ IP máy chủ xử lý email |
Chi tiết nhóm Email
GET /email/{emailId}/distribution/{distributionId}
Lấy thông tin chi tiết một distribution list (nhóm email) bao gồm danh sách thành viên.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
emailId | path | integer | Có | ID gói email |
distributionId | path | integer | Có | ID nhóm email |
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://developers-dev.inet.vn/api/gateway/v1/email/{emailId}/distribution/{distributionId}"Response
{
"id": 1,
"name": "example_name",
"status": "example_status",
"emailId": 1,
"domainName": "example_domainName",
"displayName": "example_displayName",
"emailMemberList": [
{
"id": 1,
"username": "example_username",
"domainName": "example_domainName",
"emailAccountId": 1
}
]
}
| Trường | Kiểu | Mô tả |
|---|---|---|
id | integer | ID nhóm email |
name | string | Tên nhóm (phần trước @) |
status | string | Trạng thái: enabled/disabled |
emailId | integer | ID gói email |
domainName | string | Tên miền |
displayName | string | Tên hiển thị |
emailMemberList | array | Danh sách thành viên trong nhóm |
emailMemberList[].id | integer | ID thành viên |
emailMemberList[].username | string | Tên tài khoản |
emailMemberList[].domainName | string | Tên miền |
emailMemberList[].emailAccountId | integer | ID tài khoản email |
Lấy Email theo Domain ID
GET /email/by-domain/{domainId}
Lấy thông tin gói email gắn với một tên miền cụ thể.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
domainId | path | integer | Có | ID tên miền (domain ID) |
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://developers-dev.inet.vn/api/gateway/v1/email/by-domain/{domainId}"Response
{
"id": 1,
"note": "example_note",
"type": "example_type",
"status": "example_status",
"planName": "example_planName",
"issueDate": "example_issueDate",
"dataExtend": "example_dataExtend",
"domainName": "example_domainName",
"verifyStatus": "example_verifyStatus",
"gatewayDomainRelay": "example_gatewayDomainRelay",
"gatewayDomainTransport": "example_gatewayDomainTransport"
}
| Trường | Kiểu | Mô tả |
|---|---|---|
id | integer | ID gói email |
note | string | Ghi chú gói email |
type | string | Loại gói email |
status | string | Trạng thái: active, trial, suspended, expired |
planName | string | Tên gói |
issueDate | string | Ngày kích hoạt |
dataExtend | string | JSON string chứa thông tin mở rộng của gói email |
domainName | string | Tên miền gắn với gói email |
verifyStatus | string | Trạng thái xác minh DNS: verified, not-verify |
gatewayDomainRelay | string | Tên miền xử lý email (Relay) |
gatewayDomainTransport | string | Địa chỉ IP máy chủ xử lý email |
Tổng quota Email
GET /email/{emailId}/quota
Lấy tổng dung lượng đã sử dụng và giới hạn quota của gói email.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
emailId | path | integer | Có | ID gói email |
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://developers-dev.inet.vn/api/gateway/v1/email/{emailId}/quota"Response
{
"id": 1,
"type": "example_type",
"planName": "example_planName",
"dataExtend": "example_dataExtend"
}
| Trường | Kiểu | Mô tả |
|---|---|---|
id | integer | ID gói email |
type | string | Loại gói email |
planName | string | Tên gói |
dataExtend | string | JSON string chứa thông tin quota: dung lượng (quotaCurrent/quotaLimit), tài khoản (accountCurent/accountLimit), nhóm thư (distributionListCurent/distributionListLimit) |
Kiểm tra
Xác thực địa chỉ Email
GET /email/verify/{email}
Kiểm tra địa chỉ email có hợp lệ và có thể nhận mail hay không. Kết nối đến SMTP server để verify.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
email | path | string | Có | Địa chỉ email cần xác thực (VD: [email protected]) |
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://developers-dev.inet.vn/api/gateway/v1/email/verify/[email protected]"Response
{
"data": {
"addr": "example_addr",
"code": 1,
"info": "example_info",
"banner": "example_banner",
"success": true
},
"status": "example_status"
}
| Trường | Kiểu | Mô tả |
|---|---|---|
data | object | |
data.addr | string | Địa chỉ email |
data.code | integer | Mã kết quả |
data.info | string | Thông tin chi tiết |
data.banner | string | SMTP banner |
data.success | boolean | Email hợp lệ hay không |
status | string |
Tài khoản
Đồng bộ tài khoản Email
POST /email/{emailId}/account/sync
Đồng bộ danh sách tài khoản email từ mail server.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
emailId | path | integer | Có | ID gói email |
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}' \
"https://developers-dev.inet.vn/api/gateway/v1/email/{emailId}/account/sync"Response
{
"id": 1,
"status": "example_status",
"planName": "example_planName",
"dataExtend": "example_dataExtend",
"domainName": "example_domainName"
}
| Trường | Kiểu | Mô tả |
|---|---|---|
id | integer | ID gói email |
status | string | Trạng thái gói email |
planName | string | Tên gói |
dataExtend | string | JSON string chứa quota cập nhật sau sync (accountCurent, quotaCurrent...) |
domainName | string | Tên miền |
Tạo tài khoản Email
POST /email/{emailId}/account
Tạo tài khoản email mới trong gói email.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
emailId | path | integer | Có | ID gói email |
Request Body
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
quota | integer | Không | Dung lượng (MB, VD: 512) |
status | string | Không | Trạng thái (enabled/disabled) |
password | string | Có | Mật khẩu (tối thiểu 8 ký tự, gồm 1 chữ hoa và 1 ký tự đặc biệt) |
username | string | Có | Tên tài khoản (phần trước @) |
description | string | Không | Mô tả |
displayName | string | Không | Tên hiển thị |
emailForward | string | Không | Email chuyển tiếp, phân cách bằng dấu phẩy |
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"quota":1,"status":"example_status","password":"example_password","username":"example_username","description":"example_description","displayName":"example_displayName","emailForward":"example_emailForward"}' \
"https://developers-dev.inet.vn/api/gateway/v1/email/{emailId}/account"Response
{
"id": 1,
"quota": 1,
"status": "example_status",
"emailId": 1,
"username": "example_username",
"accountId": "example_accountId",
"domainName": "example_domainName",
"description": "example_description",
"displayName": "example_displayName",
"emailForward": "example_emailForward"
}
| Trường | Kiểu | Mô tả |
|---|---|---|
id | integer | ID tài khoản email vừa tạo |
quota | integer | Dung lượng (MB) |
status | string | Trạng thái: enabled/disabled |
emailId | integer | ID gói email |
username | string | Tên tài khoản (phần trước @) |
accountId | string | UUID tài khoản trên mail server |
domainName | string | Tên miền của tài khoản |
description | string | Mô tả |
displayName | string | Tên hiển thị |
emailForward | string | Danh sách email chuyển tiếp |
Xóa tài khoản Email
DELETE /email/{emailId}/account/{accountId}
Xóa tài khoản email khỏi gói.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
emailId | path | integer | Có | ID gói email |
accountId | path | integer | Có | ID tài khoản cần xóa |
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://developers-dev.inet.vn/api/gateway/v1/email/{emailId}/account/{accountId}"Response
{
"id": 1,
"emailId": 1,
"username": "example_username",
"domainName": "example_domainName"
}
| Trường | Kiểu | Mô tả |
|---|---|---|
id | integer | ID tài khoản đã xóa |
emailId | integer | ID gói email |
username | string | Tên tài khoản đã xóa |
domainName | string | Tên miền của tài khoản |
Quản lý
Cập nhật ghi chú Email
PATCH /email/{emailId}/note
Cập nhật ghi chú cho gói email.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
emailId | path | integer | Có | ID gói email |
Request Body
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
note | string | Có | Nội dung ghi chú |
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://developers-dev.inet.vn/api/gateway/v1/email/{emailId}/note"Response
{
"id": 1,
"note": "example_note"
}
| Trường | Kiểu | Mô tả |
|---|---|---|
id | integer | ID gói email |
note | string | Ghi chú đã cập nhật |
Cập nhật nhóm Email
PATCH /email/{emailId}/distribution/{distributionId}
Cập nhật thông tin distribution list.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
emailId | path | integer | Có | ID gói email |
distributionId | path | integer | Có | ID nhóm email |
Request Body
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
name | string | Không | Tên nhóm |
status | string | Không | Trạng thái (enabled/disabled) |
description | string | Không | Mô tả |
displayName | string | Không | Tên hiển thị |
emailMemberList | string | Không | Danh sách username thành viên, phân cách bằng dấu phẩy |
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://developers-dev.inet.vn/api/gateway/v1/email/{emailId}/distribution/{distributionId}"Response
{
"id": 1,
"name": "example_name",
"status": "example_status",
"emailId": 1,
"domainName": "example_domainName",
"description": "example_description",
"displayName": "example_displayName",
"emailMemberList": [
{
"id": 1,
"username": "example_username",
"domainName": "example_domainName",
"emailAccountId": 1
}
]
}
| Trường | Kiểu | Mô tả |
|---|---|---|
id | integer | ID nhóm email |
name | string | Tên nhóm |
status | string | Trạng thái: enabled/disabled |
emailId | integer | ID gói email |
domainName | string | Tên miền |
description | string | Mô tả |
displayName | string | Tên hiển thị |
emailMemberList | array | Danh sách thành viên sau khi cập nhật |
emailMemberList[].id | integer | ID thành viên |
emailMemberList[].username | string | Tên tài khoản |
emailMemberList[].domainName | string | Tên miền |
emailMemberList[].emailAccountId | integer | ID tài khoản email |
Cập nhật trạng thái xác minh
PATCH /email/{emailId}/verify-status
Cập nhật trạng thái xác minh DNS (MX, SPF, DKIM) cho gói email.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
emailId | path | integer | Có | ID gói email |
Request Body
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
verifyStatus | string | Có | Trạng thái xác minh (VD: not-verify, verified) |
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://developers-dev.inet.vn/api/gateway/v1/email/{emailId}/verify-status"Response
{
"id": 1
}
| Trường | Kiểu | Mô tả |
|---|---|---|
id | integer | ID gói email |
Tạo DKIM Record
POST /email/{emailId}/dkim
Tạo bản ghi DKIM cho gói email để xác thực gửi mail.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
emailId | path | integer | Có | ID gói email |
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}' \
"https://developers-dev.inet.vn/api/gateway/v1/email/{emailId}/dkim"Response
{
"data": "example_data"
}
| Trường | Kiểu | Mô tả |
|---|---|---|
data | string | Plain text chứa DKIM Domain, Selector, Private Key, Public Signature, Identity. Dùng để cấu hình DNS TXT record cho DKIM. |
Tạo nhóm Email
POST /email/{emailId}/distribution
Tạo distribution list (nhóm email) mới trong gói email.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
emailId | path | integer | Có | ID gói email |
Request Body
| Trường | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
name | string | Có | Tên nhóm (phần trước @) |
status | string | Không | Trạng thái (enabled/disabled) |
description | string | Không | Mô tả |
displayName | string | Không | Tên hiển thị |
emailMemberList | string | Không | Danh sách username thành viên, phân cách bằng dấu phẩy |
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"example_name","status":"example_status","description":"example_description","displayName":"example_displayName","emailMemberList":"example_emailMemberList"}' \
"https://developers-dev.inet.vn/api/gateway/v1/email/{emailId}/distribution"Response
{
"id": 1,
"name": "example_name",
"status": "example_status",
"emailId": 1,
"domainName": "example_domainName",
"description": "example_description",
"displayName": "example_displayName",
"emailMemberList": [
{
"id": 1,
"username": "example_username",
"domainName": "example_domainName",
"emailAccountId": 1
}
]
}
| Trường | Kiểu | Mô tả |
|---|---|---|
id | integer | ID nhóm email vừa tạo |
name | string | Tên nhóm (phần trước @) |
status | string | Trạng thái: enabled/disabled |
emailId | integer | ID gói email |
domainName | string | Tên miền |
description | string | Mô tả |
displayName | string | Tên hiển thị |
emailMemberList | array | Danh sách thành viên trong nhóm |
emailMemberList[].id | integer | ID thành viên |
emailMemberList[].username | string | Tên tài khoản |
emailMemberList[].domainName | string | Tên miền |
emailMemberList[].emailAccountId | integer | ID tài khoản email |
Xóa nhóm Email
DELETE /email/{emailId}/distribution/{distributionId}
Xóa distribution list khỏi gói email.
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
emailId | path | integer | Có | ID gói email |
distributionId | path | integer | Có | ID nhóm email cần xóa |
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://developers-dev.inet.vn/api/gateway/v1/email/{emailId}/distribution/{distributionId}"Response
{
"id": 1,
"name": "example_name",
"status": "example_status",
"emailId": 1,
"domainName": "example_domainName"
}
| Trường | Kiểu | Mô tả |
|---|---|---|
id | integer | ID nhóm email đã xóa |
name | string | Tên nhóm đã xóa |
status | string | Trạng thái |
emailId | integer | ID gói email |
domainName | string | Tên miền |