Push NotificationsNotification Endpoint Notification Endpoint Object Schema
Chi tiết các trường dữ liệu của một object `NotificationEndpoint`
| Trường (Field) | Kiểu (Type) | Mô tả (Description) |
|---|
company_id | int | ID công ty (tenant) |
creator_id | int | ID người tạo/cập nhật |
id | int | ID endpoint |
owner_type | int | Loại chủ sở hữu (1: User, 3: Customer, 5: System) |
owner_id | int | ID chủ sở hữu (User ID hoặc Customer ID) |
channel_type | int | Loại kênh thông báo |
provider | string | Nhà cung cấp dịch vụ (VD: fcm, apns, telegram) |
endpoint_value | string | Giá trị endpoint (FCM token, Telegram chat ID, v.v.) |
app_code | string | Mã ứng dụng (VD: pos, web, app) |
platform | string | Nền tảng thiết bị (VD: android, ios, web) |
device_id | string | UUID thiết bị |
status | int | Trạng thái (1: Active, 3: Disabled, 5: Invalid) |
error_message | string | Thông báo lỗi (nếu bị đánh dấu Invalid) |
ip_address | string | Địa chỉ IP lần đăng ký gần nhất |
date_last_used | int | Thời gian sử dụng lần cuối (UNIX timestamp) |
date_created | int | Thời gian tạo (UNIX timestamp) |
date_modified | int | Thời gian sửa (UNIX timestamp) |
| Giá trị | Key | Mô tả |
|---|
1 | OWNER_TYPE_USER | Nhân viên / Người dùng hệ thống |
3 | OWNER_TYPE_CUSTOMER | Khách hàng |
5 | OWNER_TYPE_SYSTEM | Hệ thống (webhook, bot) |
owner_type hỗ trợ cả kiểu số (1, 3, 5) và chuỗi ("user", "customer", "system").
| Giá trị | Key | Mô tả |
|---|
1 | TYPE_EMAIL | Email |
3 | TYPE_ZNS | Zalo Notification Service |
5 | TYPE_TELEGRAM | Telegram Bot |
7 | TYPE_SMS | Tin nhắn SMS |
9 | TYPE_APP_PUSH | Push Notification (FCM/APNs) |
| Giá trị | Key | Mô tả |
|---|
1 | STATUS_ACTIVE | Đang hoạt động |
3 | STATUS_DISABLED | Đã hủy đăng ký (soft-disable) |
5 | STATUS_INVALID | Token không hợp lệ (bị từ chối bởi provider) |
{
"company_id": 10311,
"creator_id": 456,
"id": 1001,
"owner_type": 1,
"owner_id": 789,
"channel_type": 9,
"provider": "fcm",
"endpoint_value": "dGhpcyBpcyBhIGZjbSB0b2tlbg...",
"app_code": "pos",
"platform": "android",
"device_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": 1,
"error_message": "",
"ip_address": "192.168.1.1",
"date_last_used": 1740350000,
"date_created": 1740300000,
"date_modified": 1740320000
}