Skip to content

外撥名單欄位 API

概述

外撥名單欄位 API 提供對自定義欄位的管理功能,包括查詢、新增、修改和刪除操作。通過此 API,可以為外撥任務的名單定義靈活的數據結構。

欄位列表查詢

請求方式

http
GET /api/callField/list
Content-Type: application/json
Authorization: Bearer {accessToken}

查詢參數

參數名型別必填說明
pageNuminteger頁碼,預設值為 1
pageSizeinteger每頁數量,預設值為 20

請求範例

bash
curl -X GET "https://api.aicc.com/api/callField/list?pageNum=1&pageSize=20" \
  -H "Authorization: Bearer {accessToken}" \
  -H "Content-Type: application/json"

回應範例

json
{
  "code": 0,
  "message": "success",
  "data": {
    "total": 5,
    "rows": [
      {
        "id": "1",
        "fieldName": "customerName",
        "fieldLabel": "客戶姓名",
        "fieldType": "text",
        "required": 1,
        "remark": "客戶的真實姓名",
        "createTime": "2026-01-15 10:30:00"
      },
      {
        "id": "2",
        "fieldName": "phoneNumber",
        "fieldLabel": "電話號碼",
        "fieldType": "text",
        "required": 1,
        "remark": "客戶聯絡電話",
        "createTime": "2026-01-15 10:30:00"
      },
      {
        "id": "3",
        "fieldName": "address",
        "fieldLabel": "地址",
        "fieldType": "text",
        "required": 0,
        "remark": "客戶所在地址",
        "createTime": "2026-01-15 10:30:00"
      }
    ]
  }
}

回應字段說明

字段名型別說明
idstring欄位 ID
fieldNamestring欄位代碼名稱 (英文)
fieldLabelstring欄位顯示名稱 (中文)
fieldTypestring欄位類型 (text、number、date、select、textarea)
requiredinteger是否必填 (0: 否, 1: 是)
remarkstring欄位說明
createTimestring建立時間

新增欄位

請求方式

POST /api/callField/add
Content-Type: application/json
Authorization: Bearer {accessToken}

請求參數

參數名型別必填說明
fieldNamestring欄位代碼名稱,只允許字母、數字和下劃線
fieldLabelstring欄位顯示名稱
fieldTypestring欄位類型 (text、number、date、select、textarea)
requiredinteger是否必填 (0: 否, 1: 是),預設為 0
remarkstring欄位說明
optionsarray當 fieldType 為 select 時,提供選項清單

請求範例

json
{
  "fieldName": "orderAmount",
  "fieldLabel": "訂單金額",
  "fieldType": "number",
  "required": 1,
  "remark": "客戶的訂單總金額",
  "options": []
}

成功回應範例

json
{
  "code": 0,
  "message": "success",
  "data": {
    "id": "4",
    "fieldName": "orderAmount",
    "fieldLabel": "訂單金額",
    "fieldType": "number",
    "required": 1,
    "remark": "客戶的訂單總金額",
    "createTime": "2026-03-23 14:30:00"
  }
}

修改欄位

請求方式

POST /api/callField/update
Content-Type: application/json
Authorization: Bearer {accessToken}

請求參數

參數名型別必填說明
idstring欄位 ID
fieldLabelstring欄位顯示名稱
requiredinteger是否必填 (0: 否, 1: 是)
remarkstring欄位說明
optionsarray選項清單 (僅適用於 select 類型)

請求範例

json
{
  "id": "3",
  "fieldLabel": "客戶地址",
  "required": 1,
  "remark": "更新後的說明"
}

成功回應範例

json
{
  "code": 0,
  "message": "success",
  "data": {
    "id": "3",
    "fieldName": "address",
    "fieldLabel": "客戶地址",
    "fieldType": "text",
    "required": 1,
    "remark": "更新後的說明",
    "updateTime": "2026-03-23 15:00:00"
  }
}

刪除欄位

請求方式

POST /api/callField/delete
Content-Type: application/json
Authorization: Bearer {accessToken}

請求參數

參數名型別必填說明
idstring欄位 ID

請求範例

json
{
  "id": "4"
}

成功回應範例

json
{
  "code": 0,
  "message": "success",
  "data": null
}

欄位類型說明

類型說明範例
text文本類型,支援任意字符"王小明"
number數字類型,支援整數和小數99.99
date日期類型,格式為 YYYY-MM-DD"2026-03-23"
select下拉選單類型,需配合 options 參數"選項1"
textarea多行文本類型"長篇評論..."

常見錯誤

錯誤碼說明解決方案
400fieldName 不符合命名規範只使用字母、數字和下劃線
409fieldName 已存在使用不同的 fieldName
404欄位不存在確認欄位 ID 是否正確
405不能修改系統欄位系統欄位無法修改

注意事項

  1. 欄位代碼:fieldName 一旦建立不可修改,請謹慎命名
  2. 必填字段:修改欄位的 required 屬性可能影響現有數據
  3. 刪除欄位:刪除欄位會影響相關任務的數據,請謹慎操作
  4. 系統欄位:內置欄位 (customerName、phoneNumber 等) 無法刪除或修改

承暉資訊資源中心