public
POST /v1/public/chat/{publicKey}/conversations
A visitor says something for the first time.
Санҷиши ҳаққоният
Ин нуқтаи поёни оммавӣ аст. Он ҳеҷ гуна маълумоти эътимоднок ва ҳеҷ гуна созмонро талаб намекунад — он ҳамон чизест, ки сайти маркетингӣ ва муҳаррикони ҷавоби сунъии худи мо мехонанд.
Ин нуқтаи поёнӣ ягон рақами мушаххаси созмонро талаб намекунад. Калиди шумо аллакай созмонеро, ки ба он тааллуқ дорад, муайян мекунад ва ҷавоб ба он маҳдуд карда мешавад.
Санҷидан
Ҳар чизро дар қаavски кунҷӣ бо қиматҳои худ ва ҷойи нигоҳдорандаи калидро бо калима аз панели идоракунии худ иваз кунед.
curl -X POST https://api.zinndigital.com/v1/public/chat/{publicKey}/conversations \
-H "Content-Type: application/json" \
-d '{ "message": <string> }'Воarid шудаед? Консоли 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… |
Ҷисми дархост
| Ном | Намуд | Талаб карда мешавад | Ин чӣ аст |
|---|---|---|---|
message | string | Бале | — |
page_url | string | Не | — |
page_title | string | Не | — |
referrer | string | Не | — |
locale | string | Не | — |
name | string | Не | — |
email | string | Не | — |
Ҷавоб
| Ном | Намуд | Талаб карда мешавад | Ин чӣ аст |
|---|---|---|---|
state | string<ai, waiting, open, offline, closed> | Бале | — |
cursor | integer | Бале | — |
poll_after_ms | integer | Бале | 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… |
messages | ChatMessage[] | Бале | — |
conversation_id | string | Бале | — |
visitor_token | string | Бале | 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