Push NotificationsNotification Endpoint

Danh sách Endpoint của tôi

Lấy danh sách endpoint nhận thông báo của khách hàng đang đăng nhập.

Endpoint

GET /site/notificationendpoints/my

Headers

KeyValueBắt buộcMô tả
SiteTenantId{tenant_id}CóID của công ty/tenant.
SiteAuthorization{jwt_token}CóToken định danh khách hàng sau khi đăng nhập.

Workflow & Logic

API này dùng để lấy danh sách tất cả endpoint nhận thông báo đang hoạt động (ACTIVE) của khách hàng đang đăng nhập.

Quy trình xử lý

  1. Xác thực Session: Kiểm tra JWT token và xác định company_id + customer_id từ token SiteAuthorization.

  2. Tự động gán bộ lọc:

    • company_id → lấy từ session.
    • owner_type → luôn là 3 (CUSTOMER).
    • owner_id → lấy từ customer_id trong session.
    • status → luôn là 1 (ACTIVE) — chỉ trả về endpoint đang hoạt động.
  3. Lọc tùy chọn: Hỗ trợ lọc thêm qua query parameters channel_type, app_code.

  4. Truy vấn: Lấy tối đa 100 bản ghi, sắp xếp theo id DESC (mới nhất trước).

  5. Trả kết quả: Trả về danh sách endpoint kèm tổng số lượng.

Query Parameters (tùy chọn)

TênKiểuMô tả
channel_typeintLọc theo loại kênh (VD: 9 cho Push Notification).
app_codestringLọc theo mã ứng dụng (VD: pos, web).

Response Schema (200)

{
  "total": 2,
  "items": [
    {
      "company_id": 123,
      "creator_id": 0,
      "id": 456,
      "owner_type": 3,
      "owner_id": 789,
      "channel_type": 9,
      "provider": "fcm",
      "endpoint_value": "fcm_token_string...",
      "app_code": "pos",
      "platform": "android",
      "device_id": "device-uuid-1",
      "status": 1,
      "error_message": "",
      "ip_address": "192.168.1.1",
      "date_last_used": 1740350000,
      "date_created": 1740300000,
      "date_modified": 1740320000
    }
  ]
}

Mỗi item trong mảng items là một đối tượng Notification Endpoint Object.

Error Codes

HTTPMã lỗiMô tả
401error_customer_login_requiredThiếu SiteAuthorization hoặc token không hợp lệ/hết hạn.
401error_customer_company_mismatchToken khách hàng không thuộc shop của SiteTenantId.
404error_company_not_found_from_site_tenant_idSiteTenantId không hợp lệ hoặc shop không còn hoạt động.

On this page