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