メインコンテンツへスキップ

エンドポイント

POST /api/openapi/v1/data/events

概要

データ収集APIはスキーマフリー方式で動作します。event_typeでデータ種類を分類し、payloadに自由なJSON構造を送信できます。

リクエスト

{
  "events": [
    {
      "event_type": "uwb_location",
      "event_id": "loc_20260412_001",
      "source": "virtual_store_server",
      "payload": {
        "customer_id": "cust_123",
        "position": {"x": 12.5, "y": 8.3, "z": 1.2},
        "zone": "produce_section",
        "timestamp": "2026-04-12T10:30:00Z"
      }
    }
  ]
}
フィールドタイプ必須説明
eventsarrayOイベント配列(最大1,000件/リクエスト)
events[].event_typestringOイベントタイプ
events[].event_idstringX冪等性キー
events[].sourcestringXデータソース識別子
events[].payloadobjectO実データ(自由形式JSON)

レスポンス

{
  "success": true,
  "data": {"received": 2, "event_ids": ["uuid-1", "uuid-2"]}
}

イベントタイプ例

UWB位置追跡

{"event_type": "uwb_location", "payload": {"customer_id": "cust_123", "position": {"x": 12.5, "y": 8.3}, "zone": "electronics"}}

POS取引

{"event_type": "pos_transaction", "payload": {"transaction_id": "TXN001", "items": [{"sku": "A001", "qty": 1, "price": 298}], "total": 298}}

ゾーントリガー

{"event_type": "zone_trigger", "payload": {"customer_id": "cust_123", "zone": "deli_section", "trigger_type": "enter"}}

冪等性

event_idを含めると同一イベントの重複保存を防止します。

イベント照会

GET /api/openapi/v1/data/events?event_type=pos_transaction&from=2026-04-01&to=2026-04-12&limit=100
具体的なイベントタイプのスキーマはプロジェクトごとにOneSightチームと協議して定義します。