Quickchat AI 可以透過 API Actions,將面向客戶的 AI Agent 連接到自建 CRM。 設定 CRM 接受的請求,從建立回應中儲存一個 ID,再於之後的更新中使用這個 ID。你可以直接使用現有的 REST API,不必開發聊天應用程式,也不必在目錄中新增原生整合。
本教學會建置 Alder Works,一家虛構的辦公家具公司。一位訪客請團隊就六張橡木辦公桌與他聯絡。AI Agent 會以訪客的電子郵件和需求建立一筆詢問。當訪客更改時程時,AI Agent 會更新同一筆詢問。
我們在本機的 Quickchat AI 執行個體和一個實際運作的 Python CRM 上建置了這個範例。截圖呈現的是實際儲存的對話、Action 呼叫和合成的資料庫紀錄。逾時測試也揭露了重複紀錄的問題,隨附的 API 現在會以冪等鍵防止這種情況。
下載 Alder Works CRM 工具包。其中包含可執行的伺服器、紀錄檢視工具、完整的 AI Agent 設定和安裝說明。這些是可編輯的檔案,不是一鍵匯入的 AI Agent。
將 AI 聊天機器人連接到 CRM 需要什麼?
準備好帳戶、一個測試 API,以及檢查它寫入內容的方法。
- 建立 Quickchat AI 帳戶。Free 支援個人非商業學習。商業部署需要付費方案,Preview 和 Simulation 的回覆會消耗 AI 點數。對外呼叫的 API Actions 與存取 Quickchat AI REST API 是兩回事;請依你的部署情況查看目前的方案與限制。
- 下載並解壓縮工具包。為虛構的 API 安裝 Python 3.11 或更新版本以及
cloudflared。如果你的 CRM 已經有測試用的 HTTPS API,可以改用它,並調整請求與回應欄位。 - 為了第 5 步的唯寫憑證設定,將 Quickchat AI 連接到相容的 AI 用戶端。使用 ChatGPT 應用程式或 Claude 連接器,並完成 Manage with AI 中說明的擁有者登入。這個帳戶連線用來設定 AI Agent;客戶對話則會透過 HTTP 呼叫 CRM。
學習期間,請只使用本工具包中的虛構地址和紀錄。正式環境的 CRM 需要有自己的授權與資料處理規則。
第 1 步:如何啟動範例 CRM API?
隨附的服務將詢問儲存在 SQLite 中。它有兩個寫入端點:POST /enquiries 建立紀錄,PATCH /enquiries/<id> 變更其時程。它的檢視頁面和指令讀取的是同一個資料庫。
在解壓縮後的目錄中開啟終端機。為這個示範產生權杖:
python -c 'from pathlib import Path; import secrets; p=Path(".crm-demo-token"); p.write_text(secrets.token_urlsafe(32)+"\n"); p.chmod(0o600)'
啟動 API,並讓該終端機持續執行:
python crm_server.py --token-file .crm-demo-token --state crm-state
在另一個終端機中,透過臨時的 HTTPS 位址公開它:
cloudflared tunnel --url http://127.0.0.1:8766
複製指令輸出的 https://…trycloudflare.com 位址。開啟它的 /health 路徑,確認顯示 ready。讓兩個程序都保持執行。Cloudflare 的 Quick Tunnel 說明涵蓋安裝方式與臨時位址的行為。重新啟動通道後主機名稱可能會改變;若有改變,請同時更新兩個 Actions。
請妥善保管 .crm-demo-token。你會在 Action 編輯器中輸入它的值,而不是在 AI Agent 的提示詞或對話中輸入。
一個 API 呼叫如何為下一個呼叫提供 ID?
建立回應會傳回一個 ID。Save to memory 會將它儲存在 crm_enquiry_id 底下;更新 URL 則從同一段對話讀取 {{metadata_crm_enquiry_id}}。AI Agent 選擇要執行的操作並提供時程,儲存的參照由 Quickchat AI 插入。
概念圖。範例參照代表一筆紀錄,並不是需要訪客輸入的 ID。
| 操作 | 請求 | 成功回應 |
|---|---|---|
| 建立 | 包含電子郵件、需求和選填時程的 POST /enquiries | 包含 id 和 status: created 的 201 |
| 核對完全相同的重試 | 相同的 POST 本文和 Idempotency-Key | 包含原本 id 和 status: already_created 的 200 |
| 更新 | 只包含時程的 PATCH /enquiries/<saved-id> | 包含該 id 和 status: updated 的 200 |
如果同一個建立鍵帶有不同的欄位值,示範 API 會傳回 409,且不會進行額外寫入。新的對話會取得新的鍵,可以建立另一筆詢問。
第 2 步:如何給 AI Agent 分派工作?
建立新的 AI Agent 並開啟 Identity。將 Name 設為 Alder Works。在 Main Prompt 旁選擇 Edit,貼上經過測試的完整提示詞。這些設定會自動儲存。
這份提示詞給 AI Agent 一個範圍明確的工作:收集電子郵件和家具需求、建立一筆詢問,之後只變更其時程。價格、交貨承諾和其他欄位的變更由團隊處理。這是以 Action 為核心的範例,寫入詢問並不需要 Knowledge Base。如果你也希望它回答產品或政策問題,請加入經過查證的公司知識。

Action 編輯器將五個決定分開處理:要先問使用者什麼、要傳送哪個請求、AI Agent 何時該呼叫它、要儲存什麼供之後使用,以及必須符合哪些條件。在下方每個做法中,都要明確設定這些決定。
第 3 步:如何透過 REST API 建立詢問?
開啟 Actions & MCPs。在 Custom Actions 底下選擇 Add Action,再選擇 API Action。如果出現由描述產生 Action 的對話框,請選擇 Create manually。這個 Action 會將訪客的電子郵件和專案細節轉成一個 POST 請求。
將 API Action Name 設為 create_enquiry,When to run 設為 AI decides。
在 What to ask the user first 底下建立以下參數。除了名稱,也請複製說明;說明會告訴 AI Agent 缺少值時該怎麼做,以及必須保留哪些內容。
| 格式 | 名稱 | 說明 | 必填 |
|---|---|---|---|
| Text | email | 訪客的電子郵件地址,供團隊回覆。缺少時要詢問;不要捏造地址。 | 是 |
| Text | requirements | 訪客提供的專案需求,保留重要細節。缺少時詢問需要什麼家具。 | 是 |
| Text | timeline | 以訪客自己的話描述的時間範圍,包含不確定的部分。未提供時程時使用空字串;絕不捏造日期。 | 否;預設值留空 |
在 API Endpoint 底下使用:
POST https://YOUR-CRM-HOST/enquiries
將 https://YOUR-CRM-HOST 換成你的通道 URL。新增以下 Headers;在第 5 步之前保留 Authorization 預留值。
| 鍵 | 值 |
|---|---|
Content-Type | application/json |
Authorization | Bearer REPLACE_IN_DASHBOARD |
Idempotency-Key | {{conversation_id}} |
使用 Add AI Data 為 Idempotency-Key 插入 Built-in → conversation_id 的值。對於這個一段對話只建立一筆詢問的工作流程,它是穩定的鍵。它不能是訪客提供的文字。
選擇 Body,選擇 JSON 編輯器,然後輸入:
{
"email": "{{email}}",
"requirements": "{{requirements}}",
"timeline": "{{timeline}}"
}
在編輯器中使用 Add AI Data 插入具名參數標籤。上方的大括號只是說明每個位置對應哪個具名值;編輯器會填入其內部參照。保留每個標籤周圍的 JSON 字串引號。
原封不動貼上以下 API Action Description:
Create one Alder Works project enquiry when the visitor wants the team to follow up and has provided both their email address and project requirements. Ask for either required value if missing. Timeline is optional: use an empty string if the visitor has not supplied it. Once a reference is saved, use update_enquiry_timeline for timeline changes. If an earlier request had an unknown outcome and the visitor explicitly asks to try again, this same action safely reconciles it using the conversation ID inserted in the Idempotency-Key header; reuse the original field values exactly. Identical retries return the original enquiry; changed field values return an idempotency conflict without creating or modifying a record. A conflict requires the team to check the saved record, and must not be described as a successful update. After success, confirm the saved enquiry briefly. Do not offer to append, note, add or change dimensions, quantities, materials, contact details or other requirements: no action can store those changes after creation. Only the timeline can be updated.
在 Save to memory 中新增兩列:
| 來源 | 要儲存的值 | 記憶鍵 |
|---|---|---|
| API response | $.id | crm_enquiry_id |
| Action input | 從下拉選單選取的 email 參數 | visitor_email |
在 API response 列中,Value to save 填入 JSONPath 運算式;在 Action input 列中,它會列出 Action 的參數。第一列儲存 CRM 傳回的 ID,更新 Action 之後會讀取它。第二列將 AI Agent 傳送給 CRM 的電子郵件複製到 Inbox 中該對話的 Visitor 資訊,讓團隊不必開啟 CRM 就能看到詢問屬於誰。只有在對話尚無電子郵件時才會填入此欄位,絕不會取代客服人員輸入或清除的值;而且它在請求送出前就已儲存,因此 CRM 發生錯誤也不會遺失。
產生端儲存 CRM 傳回的 ID,下一個 Action 會讀取這個鍵。
開啟 Advanced settings。在 Run only when 底下新增 crm_enquiry_id,條件設為 does not exist。在 Response filter 底下新增 $.nothing_to_return。
測試 API 刻意在成功回應中省略 nothing_to_return,因此模型收到的是空的回應物件。Save to memory 仍會從完整回應中擷取 ID。儲存的 ID 本身屬於對話中繼資料,模型和客服人員都看得到;絕不要將憑證放進記憶。錯誤回應也必須精簡,且不得包含私密紀錄。
Save to memory 文件說明了產生端與使用端的關係。
儲存 Action,並在完成第 5 步前保持停用。
第 4 步:如何在後續訊息中更新詢問?
新增第二個 API Action。它只會變更同一段對話中先前建立的紀錄的時程,不會取代電子郵件或專案需求。
將 API Action Name 設為 update_enquiry_timeline,When to run 設為 AI decides。
在 What to ask the user first 底下建立以下參數。除了名稱,也請複製說明;說明會告訴 AI Agent 缺少值時該怎麼做,以及必須保留哪些內容。
| 格式 | 名稱 | 說明 | 必填 |
|---|---|---|---|
| Text | timeline | 訪客提供的新時間範圍,使用他自己的話。缺少時要詢問;保留不確定的部分,不要捏造日期。 | 是 |
在 API Endpoint 底下使用:
PATCH https://YOUR-CRM-HOST/enquiries/{{metadata_crm_enquiry_id}}
將 https://YOUR-CRM-HOST 換成你的通道 URL。新增以下 Headers;在第 5 步之前保留 Authorization 預留值。
| 鍵 | 值 |
|---|---|
Content-Type | application/json |
Authorization | Bearer REPLACE_IN_DASHBOARD |
在第 5 步替換預留值時,請保留 Authorization 標頭所在的同一個已儲存列。
選擇 Body,選擇 JSON 編輯器,然後輸入:
{
"timeline": "{{timeline}}"
}
在編輯器中使用 Add AI Data 插入具名參數標籤。上方的大括號只是說明每個位置對應哪個具名值;編輯器會填入其內部參照。保留每個標籤周圍的 JSON 字串引號。
原封不動貼上以下 API Action Description:
Change or add the timeline of the enquiry already created in this conversation when the visitor supplies a new timeframe. The saved enquiry reference is inserted automatically; never ask for or use a record ID typed by the visitor. This request changes only the timeline and preserves the email and project requirements. If no reference is available after an earlier creation attempt, do not create a replacement: tell the visitor the team must check the record.
這個 Action 的 Save to memory 保持空白。在 Advanced settings 中,將 Run only when 設為 crm_enquiry_id exists,Response filter 設為 $.nothing_to_return。
更新需要建立時產生的參照。Quickchat AI 會在送出請求前檢查條件。
使用 Add AI Data 將對話記憶中的值插入 URL。不要為訪客新增 enquiry_id 問題。Run only when 文件說明了這些條件如何判斷。
儲存 Action,並在完成第 5 步前保持停用。
第 5 步:如何以私密方式輸入 API 憑證?
截圖使用的是唯寫的 Authorization 標頭。目前的儀表板可以保留並替換既有的機密標頭,但沒有提供建立機密標頭的核取方塊。在輸入真正的權杖之前,先透過帳戶 MCP 連線一次,將兩個預留值標頭標記為機密。
向已連接你 Quickchat AI 帳戶的 AI 用戶端傳送以下設定請求:
Find my Alder Works Agent and its existing create_enquiry and update_enquiry_timeline API Actions. Keep both inactive. Preserve their parameters, URLs, request bodies, descriptions, response filters, Save to memory rules and Run only when conditions. For each Action, set the existing Authorization header to the literal value "Bearer REPLACE_IN_DASHBOARD" with is_secret=true. Preserve every other header, including Idempotency-Key on create_enquiry. Do not send an HTTP test request, run a Simulation or activate either Action. Show me the saved configuration with credentials redacted. I will enter the real token myself in the dashboard.
回到儀表板中的每個 Action。在 Headers 中,將既有的 Authorization 值 [redacted] 換成 Bearer 加上本機 .crm-demo-token 檔案中的權杖。保留同一列和同一個標頭名稱;不要刪除後重新建立。儲存、關閉後重新開啟編輯器。該值應再次顯示為 [redacted]。
預留值刻意設為無效,無法通過任何請求的驗證。兩組真正的憑證都儲存後,啟用兩個 Actions。Idempotency-Key 標頭維持一般的動態值,讓 Quickchat AI 能插入對話 ID。
你也可以請已連接帳戶的助理依照 demo-config.json 設定整個做法,包括 Main Prompt 和測試資料集。請它以停用狀態建立寫入型 Actions、只使用預留憑證,並在測試前停止。建立設定不會寫入 CRM;Test Response 和 Simulation 可能會傳送真實請求,而 Simulation 的回覆會消耗點數。機密仍由擁有者輸入,啟用也由擁有者審查。
第 6 步:如何證明更新的是同一筆紀錄?
開啟 AI Preview 並開始新的對話。依序傳送以下兩則訊息,每則之間等待回覆:
Please ask your team to contact me. My email is alex@example.com. We need six oak desks with cable trays for a small studio. We are aiming for late November.
Please change the timeline to early December.
收到第一則回覆後,在另一個終端機中檢查 CRM:
python inspect_crm.py --state crm-state
應該會有一筆包含電子郵件和需求的新詢問。收到第二則回覆後再執行一次指令。該紀錄應保留原本的 ID、電子郵件和需求,只有時程改為十二月初。

一段已儲存的本機測試對話。確認訊息對訪客很有幫助;真正證明寫入的是呼叫紀錄和 CRM 紀錄。
在 Inbox 中開啟對話,展開每則回覆下方的 1 action called。確認第一次呼叫是 create_enquiry,第二次是 update_enquiry_timeline。對話的 Visitor 資訊會顯示建立呼叫中的電子郵件。在 Actions & MCPs 中,對更新 Action 選擇 View logs,檢查解析後的 URL 和狀態。

這份紀錄讀取的是實際的 SQLite 紀錄。建立和時程更新使用同一個參照。
比對全部三項證據:對話、解析後的請求,以及 CRM 中儲存的狀態。光憑一則看似可信的回覆,並不能證明 API 寫入真的發生了。
第 7 步:如何測試資訊缺漏與故障?
在 Testing 中選擇 Create Dataset。將它命名為 Alder Works: project enquiry checks,然後加入下方四則初始訊息,每列一則。它們也包含在 demo-config.json 中。
Please ask your team to contact me. My email is alex@example.com. We need six oak desks with cable trays for a small studio. We are aiming for late November.
Please have someone contact me about six oak desks with cable trays. We would like them in late November.
Please contact me at casey@example.com about a project.
Please ask your team to contact me at sam@example.com. We need two reception desks with accessible counter space. I do not have a timeline yet.
在 Evaluation criteria 底下,告訴評估器要如何檢查回覆:
Alder Works makes custom office furniture; only its human team can confirm feasibility, prices and delivery dates. Email and project requirements are required; a furniture type and quantity are sufficient requirements. Dimensions, finish, frame style and complete specifications are not required. Ask only when email or any meaningful furniture requirement is absent. Timeline is optional and may be empty or uncertain. Do not promise a binding quote or firm delivery. After creation, only the timeline can be changed; do not offer to append other fields. The agent performs real HTTP writes as silent side effects; do not penalize a reply for not displaying them. This evaluator cannot inspect the CRM and cannot verify that the write occurred or that a later update reached the same record. Those facts must be checked in the action logs and CRM.

針對虛構 API 選擇 Run。每一列都會開始一段獨立的對話。執行完畢後檢查請求和紀錄。若要測試缺少電子郵件時的復原,請開始新的 AI Preview 對話,傳送資料集中缺少電子郵件的那則訊息,等待回覆,然後在同一段對話中傳送 My email is robin@example.com.。
資料集中的一列並不是上一列的延續。 提供歷史紀錄給批次評估器,並不能證明 AI Agent 本身建立並記住了紀錄。請在一段真實對話中完成兩則訊息的建立與更新測試,並確認其記憶和解析後的 URL。
工具包也包含故障訊息。若要重現受控的伺服器故障,請建立 faults.json,內容如下:
{
"reject@example.com": "reject",
"missing-id@example.com": "missing_id",
"uncertain@example.com": "commit_then_delay"
}
停止伺服器,然後以相同的狀態和權杖並加上 --fault-file faults.json 重新啟動。讓通道持續執行。這些故障僅供合成測試使用;完成後請移除該旗標。針對驗證的情況,暫時設定一個無效的 Authorization 值,之後再還原。
| 測試 | 要檢查的內容 |
|---|---|
| 缺少電子郵件 | AI Agent 在建立紀錄前詢問電子郵件。 |
| 缺少專案需求 | AI Agent 詢問需要什麼家具。 |
| 沒有時程 | 允許以空白時程建立。 |
| CRM 以 422 拒絕請求 | 不會寫入任何紀錄;回覆不得聲稱成功。 |
| CRM 已儲存但省略 ID | 沒有參照,之後的更新無法執行。在嘗試建立替代紀錄前先檢查紀錄。 |
| CRM 儲存後延遲回應 | AI Agent 不知道最初的結果。依下文所述檢查重試和紀錄數量。 |
| 無效的憑證 | 不會建立紀錄;不會向訪客索取你的服務權杖。 |
| 訪客輸入另一個紀錄 ID | 更新 Action 仍需要已儲存的參照;輸入的文字不等於授權。 |
第 8 步:逾時測試之後改了什麼?
最終做法中一次實際的逾時回覆。CRM 已儲存紀錄,但 AI Agent 沒有收到它的參照。
我們示範 API 的第一個版本會為每個被接受的 POST 建立一筆新紀錄。我們讓它先寫入詢問,再把回應延遲到超過 Action 的讀取逾時時間。在那個初始設定下,AI Agent 無法確認是否已儲存。當訪客要求重試時,第二個 POST 又建立了第二筆詢問。
這個故障說明了為什麼以成功回應為基礎的記憶規則無法涵蓋每一次重試。第一個請求已經改變了 CRM,但 Quickchat AI 並未收到可儲存的 ID。does not exist 條件仍允許建立。
我們修改了 API,在整合範圍和 Idempotency-Key 底下以不可分割的方式儲存建立結果。完全相同的重試會傳回原本的 ID。酬載有所變更時會傳回 409 idempotency_conflict,既不建立也不修改紀錄。完整的鍵政策已實作在隨附的伺服器中。
調整這個工作流程以符合自身需求時,請重複以下調校循環:
- 傳送故障訊息,檢查回覆、請求紀錄和 CRM 狀態。
- 找出是哪一層出了問題。資訊缺漏屬於收集規則;重複寫入則需要伺服器端的建立政策。
- 修改設定或 API 約定中的一個部分。
- 在新的對話中重複相同訊息,比較實際寫入的結果。
在最終的兩則訊息測試中,第一個 POST 寫入了 enq_019,接著在 AI Agent 收到回應前逾時。訪客要求重試。相同的請求本文和鍵傳回 200,其中包含 status: already_created 和原本的 ID。CRM 只有一筆新紀錄,對話記憶中保存著 crm_enquiry_id: enq_019。
| 觀察到的設定 | POST 請求 | 新增 CRM 紀錄 | AI Agent 看到的結果 |
|---|---|---|---|
| 初始 API,沒有冪等鍵 | 2 | 2 | 兩次回覆都逾時;沒有儲存參照。 |
| 最終做法,穩定的鍵和一致的酬載 | 2 | 1 | 重試取回了既有的參照。 |
這些是故障與復原的受控範例,並非實測的可靠度比率。最終做法經過驗證並完整重跑;較早的設定並不是只改提示詞的受控比較。
目前的提示詞要求 AI Agent 避免自動重試,只在訪客要求時才核對未知的結果。即使 AI Agent 選擇重試,伺服器也會針對同一個鍵防止重複。不同的對話有不同的鍵,所以這並不是以客戶為單位的去重。
先前還有一則回覆在建立詢問後主動提議補上辦公桌尺寸,但我們唯一的更新 Action 只能變更時程。我們在 Main Prompt 和建立 Action 的說明中都明確寫出了這個限制。除了檢查下一個 API 呼叫,也要檢查下一則回覆:即使請求本身正確,無法兌現的提議也可能誤導訪客。
第 9 步:如何套用到你自己的 CRM?
將虛構的 API 換成你 CRM 的測試端點,更新欄位對應,然後在連接公開管道之前執行相同的檢查。
| 如果你的 CRM 變更了… | 需要更新並確認… |
|---|---|
requirements 改為 project_summary | JSON 本文的鍵、對應的參數說明,以及完整訊息測試所產生的 CRM 紀錄。 |
建立回應將 ID 巢狀放在 data.enquiry.id 底下 | 將擷取路徑改為 $.data.enquiry.id,再確認解析後的後續 URL。 |
| 新增一個必填欄位 | 收集規則和缺漏欄位測試,包括伺服器的驗證錯誤。 |
| 之後需要編輯電子郵件或專案細節 | 一個專門針對這些欄位的更新端點、Action 做法和測試。只修改提示詞並不會增加 API 功能。 |
| API 的重試約定不同 | 冪等標頭、鍵的範圍、衝突處理和核對程序。 |
服務權杖用來驗證整合,並不能確認正在對話的是哪位客戶。這個做法不提供 AI Agent 任何讀取端點,只接受新的詢問;存取既有客戶紀錄的工作流程必須驗證訪客身分,並在伺服器上授權該紀錄。將擷取的參照和管道中繼資料與使用者提供的識別碼分開。
將憑證存放在對話記憶之外,錯誤本文中不要包含私密紀錄,並只給整合它需要的操作。條件閘門控制 Action 能否執行;授權和持久寫入仍由 CRM 負責。
測試 API 驗證完成後,使用穩定的正式 HTTPS 端點、替換示範權杖,並在 Channels 底下連接目標管道。透過該管道再完整執行一次兩則訊息的測試。若是網站,網站管道指南說明了如何嵌入小工具。若是已支援的 CRM,HubSpot 教學使用其原生連線和範本。
完成後,以 Ctrl+C 停止臨時通道和示範伺服器。它們的 SQLite 狀態會保留下來,方便之後檢查。
完整的 Main Prompt
在第 2 步將以下內容貼到 AI Agent 的 Main Prompt 中。工具包的 demo-config.json 也包含相同的文字。
You are the project enquiry assistant for Alder Works, a fictional company that builds custom office furniture. Help visitors describe the furniture they need and pass their enquiry to the team when they want follow-up. The team confirms feasibility, prices and delivery dates; you cannot promise a binding quote, availability or a production slot.
Ask for the visitor's email address and project requirements if either is missing. A stated furniture type and quantity are enough to capture an enquiry; do not require dimensions, finishes or a complete specification before saving it. Do not ask again for requirements the visitor already supplied. A timeline is optional. Preserve the visitor's words, including uncertainty; do not invent a calendar date. When the visitor wants follow-up and has supplied email and requirements, call create_enquiry once. If they have not supplied a timeline, use an empty string.
After create_enquiry succeeds, do not call it again for that enquiry. When the visitor changes or supplies the timeline later, call update_enquiry_timeline to update the enquiry already created in this conversation. The saved reference is inserted automatically. This demo can change only the timeline after creation. Do not offer or claim to append or change email addresses, quantities, materials, dimensions or other project requirements; explain that the team must handle those changes. Never ask the visitor for a record ID or use an ID they type. Do not look up or disclose existing customers or enquiries.
If create_enquiry is refused because an enquiry reference already exists, use update_enquiry_timeline for a timeline change. If update_enquiry_timeline is refused because no reference exists, only create an enquiry if there has been no earlier creation attempt and the required details are available. If an earlier creation succeeded but no usable reference was saved, explain that the team must check the record before the timeline can be changed; do not create a replacement.
Only say an enquiry was saved or updated after the corresponding action reports success. If a request is rejected, explain that it was not saved and ask only for a correction the error calls for. If authentication fails, say that the connection needs the team's attention; never ask the visitor for an integration credential. If a request times out or its outcome is unknown, say that you cannot confirm whether it was saved. Do not retry automatically. If the visitor explicitly asks you to try again, call create_enquiry again to reconcile the outcome. Its Idempotency-Key header uses the same conversation ID. Reuse the originally submitted field values exactly: if the first request committed, an identical retry returns the original record. A changed payload returns an idempotency conflict without making another record. If that conflict occurs, say the team must check the saved record; do not claim the revised details were stored. Do not invent a new key or claim success before that action succeeds. After success, confirm only the enquiry and the timeline actually saved; do not invite further specification changes that you cannot store.
Write briefly and plainly. Do not show internal action names, memory keys or service credentials in your replies.
常見問題
可以將 AI 聊天機器人連接到內部 CRM 嗎?
可以,只要 CRM 提供合適的 HTTP API。在 Quickchat AI 中,為訪客需要的特定操作設定 API Actions。本教學會建立一筆詢問、儲存回傳的參照,並在同一段對話中更新其時程。你的 CRM 仍需自行驗證請求並落實存取規則。
我的 CRM 需要原生整合或 MCP 伺服器嗎?
不需要。這個工作流程使用兩個設定為 API Actions 的 REST 端點。現有的 HTTPS API 可能就已足夠。設定時使用的帳戶 MCP 連線負責管理 Quickchat AI 設定,與客戶對話中呼叫的 CRM API 是分開的。
聊天機器人能記住 API 回傳的 ID 嗎?
Save to memory 會將回應中的某個值儲存在對話記憶的鍵底下。更新 Action 透過中繼資料變數插入這個值。在這裡,$.id 會成為 crm_enquiry_id,而 PATCH URL 使用 {{metadata_crm_enquiry_id}}。請以你的 API 實際的回應結構為準。
儲存的 ID 能避免 CRM 出現重複紀錄嗎?
建立條件會在該對話儲存參照後阻止再次建立。不過,逾時可能發生在參照被擷取之前。因此,隨附的示範 API 也使用 Idempotency-Key:完全相同的重試會傳回原本的紀錄,而同一個鍵搭配已變更的酬載則會傳回衝突。新的對話會使用不同的鍵。
之後可以更改 CRM 欄位對應嗎?
可以。依照新的 API 約定編輯 Action 的請求本文、參數說明與回應擷取設定,然後重新進行建立和後續更新測試。將識別碼與訪客提供的欄位分開。CRM 的結構變更不會自動更新 Action。
這個工作流程可以查詢現有客戶嗎?
這個做法只會建立新的詢問,不提供讀取客戶資料的 Action。先查詢再寫入需要一個經過驗證的查詢端點,以及伺服器端對回傳紀錄的授權。在聊天中輸入的電子郵件地址或紀錄 ID 並不能證明所有權。
這些 Actions 需要寫程式或 Business 方案嗎?
你在儀表板中設定 AI Agent 和 Actions。隨附的虛構 CRM 以 Python 指令碼執行;真正的自訂整合需要合適的現有 API 或後端開發。對外呼叫的 API Actions 與 Quickchat AI REST API 的使用權限是分開的。Free 適用於個人非商業學習;商業部署需要付費方案。Preview 和 Simulation 的回覆會消耗 AI 點數。