Skip to Content
API 參考洞察系統

洞察系統

選擇聊天室要載入哪些部門標籤系統供代理洞察使用;此開關不會改動資料表授權或 ACL。

GET
路由範本/private/chatrooms/setting/custom-table-tags/{chatroom_id}
用途

依部門標籤整理聊天室已獲授權的資料表,並顯示各系統是否已開啟載入。

適用時機

在顯示代理洞察的系統開關與可用資料表前使用。

實際掛載路徑
  • 完整路由/private/chatrooms/setting/custom-table-tags/{chatroom_id}

範圍

範圍是否提供驗證與權限
完整路由可使用ChatRoomManagerAccessRequired

參數

欄位位置型別必填說明
chatroom_idpathuuid要查詢的聊天室 UUID。

回應結構

InsightSystemsResponse
欄位型別必填說明
systemsInsightSystemGroup[]Sorted by (department_name, name)
untaggedInsightTagTableInfo[]Granted dept tables with no system tag — always load, not flippable

範例

取得聊天室洞察系統

請求
{
  "pathParams": {
    "chatroom_id": "11111111-1111-4111-8111-111111111111"
  }
}
回應200
{
  "systems": [
    {
      "tag_id": "33333333-3333-4333-8333-333333333333",
      "name": "訂單系統",
      "description": "訂單與出貨資料",
      "color": "#2563EB",
      "department_id": "22222222-2222-4222-8222-222222222222",
      "department_name": "營運部",
      "enabled": true,
      "tables": [
        {
          "table_id": "44444444-4444-4444-8444-444444444444",
          "name": "訂單",
          "description": "客戶訂單",
          "audiences": [
            "internal"
          ]
        }
      ]
    }
  ],
  "untagged": []
}

錯誤

狀態發生條件錯誤本文
403呼叫者不是聊天室管理者。
{
  "detail": "Insufficient permissions, not the creator. (Required department manager)"
}
PUT
路由範本/private/chatrooms/setting/custom-table-tags/{chatroom_id}

設定聊天室洞察系統

用途

以 tag_ids 完整取代聊天室已開啟載入的部門標籤系統。

適用時機

聊天室管理者要開啟、關閉或重設代理洞察來源時使用。

實際掛載路徑
  • 完整路由/private/chatrooms/setting/custom-table-tags/{chatroom_id}

範圍

範圍是否提供驗證與權限
完整路由可使用ChatRoomManagerAccessRequired

參數

欄位位置型別必填說明
chatroom_idpathuuid要更新的聊天室 UUID。

請求結構

InsightSystemSelectionPayload
欄位型別必填說明
tag_idsstring[]Dept-scope tag ids to enable. Deduplicated. Empty list disables all systems.

回應結構

InsightSystemsResponse
欄位型別必填說明
systemsInsightSystemGroup[]Sorted by (department_name, name)
untaggedInsightTagTableInfo[]Granted dept tables with no system tag — always load, not flippable

範例

只開啟訂單系統

請求
{
  "pathParams": {
    "chatroom_id": "11111111-1111-4111-8111-111111111111"
  },
  "body": {
    "tag_ids": [
      "33333333-3333-4333-8333-333333333333"
    ]
  }
}
回應200
{
  "systems": [
    {
      "tag_id": "33333333-3333-4333-8333-333333333333",
      "name": "訂單系統",
      "description": "訂單與出貨資料",
      "color": "#2563EB",
      "department_id": "22222222-2222-4222-8222-222222222222",
      "department_name": "營運部",
      "enabled": true,
      "tables": [
        {
          "table_id": "44444444-4444-4444-8444-444444444444",
          "name": "訂單",
          "description": "客戶訂單",
          "audiences": [
            "internal"
          ]
        }
      ]
    }
  ],
  "untagged": []
}

錯誤

狀態發生條件錯誤本文
400tag_ids 含有未附在任何已授權給此聊天室的部門資料表上之標籤。
{
  "detail": "Tag IDs not eligible for this chatroom: ['33333333-3333-4333-8333-333333333333']"
}
403呼叫者不是聊天室管理者。
{
  "detail": "Insufficient permissions, not the creator. (Required department manager)"
}
Last updated on