OVIRO LogoOVIRO
Push NotificationsNotification Endpoint

Đăng ký Endpoint

Đăng ký hoặc cập nhật endpoint nhận thông báo (upsert by owner-scope).

Endpoint

POST /v1/notificationendpoints/register

Body Parameters

TênKiểuBắt buộcMô tả
company_idintID công ty
owner_typeint | stringLoại chủ sở hữu (1/"user", 3/"customer", 5/"system")
owner_idintID chủ sở hữu (User ID hoặc Customer ID)
channel_typeintLoại kênh thông báo (VD: 9 = Push)
endpoint_valuestringGiá trị token/endpoint (VD: FCM registration token)
app_codestringMã ứng dụng (VD: pos, web, app)
creator_idintID người thực hiện đăng ký. Mặc định: 0
providerstringNhà cung cấp dịch vụ push. Mặc định: fcm
platformstringNền tảng thiết bị (VD: android, ios, web)
device_idstringUUID thiết bị

Ví dụ JSON

{
  "company_id": 10311,
  "creator_id": 456,
  "owner_type": 1,
  "owner_id": 789,
  "channel_type": 9,
  "provider": "fcm",
  "endpoint_value": "fcm_token_string...",
  "app_code": "pos",
  "platform": "android",
  "device_id": "device-uuid-string"
}

Response Schema

HTTP 200 - JSON Object

Trả về object Notification Endpoint vừa tạo/cập nhật.

Error Codes

HTTPCodeMô tả
422error_company_id_requiredID công ty không được để trống
422error_owner_type_requiredLoại chủ sở hữu không được để trống
422error_owner_type_invalidLoại chủ sở hữu không hợp lệ
422error_owner_id_requiredID chủ sở hữu không được để trống hoặc phải > 0
422error_channel_type_requiredLoại kênh không được để trống hoặc phải > 0
422error_endpoint_value_requiredGiá trị endpoint không được để trống
422error_app_code_requiredMã ứng dụng không được để trống
500error_register_endpointLỗi khi đăng ký endpoint

On this page