public

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

A visitor says something for the first time.

Све public крајње тачке

Сва документација за програмере →

Аутентификација

Ова крајња тачка је јавна. Не захтева никакве акредитиве нити организацију — то је оно што читају наш сопствени маркетиншки сајт и машине за одговоре са вештачком интелигенцијом.

Ова крајња тачка не прихвата id организације. Ваш кључ већ идентификује организацију којој припада, а одговор је ограничен на њу.

Испробајте

Замените све што је у угластим заградама сопственим вредностима, а чувар места кључа кључем са своје контролне табле.

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

Пријављени сте? API конзола на вашој контролној табли попуњава ваш прави id организације и ваш сопствени кључ, и покреће захтев према живом 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