public

POST /v1/public/chat/{publicKey}/conversations

A visitor says something for the first time.

همه نقاط پایانی public

همهٔ مستندات توسعه‌دهندگان

احراز هویت

این نقطه پایانی عمومی است. هیچ مدرک احراز هویت و هیچ سازمانی نمی‌پذیرد — این همان چیزی است که سایت بازاریابی خودمان و موتورهای پاسخ‌دهنده هوش مصنوعی می‌خوانند.

این نقطه پایانی هیچ شناسه سازمانی را دریافت نمی‌کند. کلید شما در حال حاضر سازمان مربوطه را مشخص می‌کند و پاسخ در همان محدوده ارائه می‌شود.

امتحان کنید

هر چیزی را که داخل براکت‌های زاویه‌دار قرار دارد با مقادیر خودتان جایگزین کنید، و نگهدارنده کلید را با کلیدی از داشبورد خود جایگزین نمایید.

curl -X POST https://api.zinndigital.com/v1/public/chat/{publicKey}/conversations \
  -H "Content-Type: application/json" \
  -d '{ "message": <string> }'

وارد شده‌اید؟ کنسول API در داشبورد شما شناسه سازمان واقعی و کلید خودتان را پر می‌کند و درخواست را روی API زنده اجرا می‌کند تا بتوانید پاسخ واقعی را ببینید. این نقطه پایانی را در کنسول API باز کنید

جزئیات

Anonymous. Opens a conversation and writes the visitor's first message, then lets the assistant answer it inline if the customer has AI switched on. The response carries a visitorToken once and never again. It is a bearer secret — the only thing standing between one visitor and another's transcript on the same site — so the widget keeps it in the visitor's own storage and presents it in X-Zinn-Chat-Token on every subsequent call. It is never accepted in a query string, because a query string is written to every access log.

پارامترها

نامنوعالزامیچیست
publicKey (path)stringبلهThe widget's public key. Public by design — it ships in the page source of every site that embeds the widget — so it NAMES a widget and authorises nothing; the Origin header is…

بدنه درخواست

نامنوعالزامیچیست
messagestringبله
page_urlstringخیر
page_titlestringخیر
referrerstringخیر
localestringخیر
namestringخیر
emailstringخیر

پاسخ

نامنوعالزامیچیست
statestring<ai, waiting, open, offline, closed>بله
cursorintegerبله
poll_after_msintegerبلهHow long the widget should wait before asking again. Decided by the SERVER on every response, because a cadence baked into the widget is cached on somebody else's site behind…
messagesChatMessage[]بله
conversation_idstringبله
visitor_tokenstringبلهReturned ONCE and never again. A bearer secret — the only thing between one visitor and another's transcript on the same site — presented afterwards in X-Zinn-Chat-Token, never…

خطاهایی که این نقطه پایانی می‌تواند برگرداند

404 · 422 · 429