public
POST /v1/public/chat/{publicKey}/conversations
A visitor says something for the first time.
تصدیقهویت
دا پای ټکی عامه دی. دا هېڅ اعتبار او هېڅ سازمان ته اړتیا نه لري - دا هغه څه دي چې زموږ خپله د بازار موندنې پاڼه او د مصنوعي ځيرکتیا د ځواب انجنونه یې لولي.
دا پای نقطه د سازمان هېڅ آی ډي نه اخلي. ستاسو کیلي مخکې تر مخکې هغه سازمان په ګوته کوي چې پورې اړه لري، او ځواب ورته محدود دی.
هڅه وکړئ
د انګلیسي په زاوي پنسونو کې هرڅه د خپلو ارزښتونو سره بدل کړئ، او د کلي ځای لرونکی ستاسو د ډشبورډ د کلي سره.
curl -X POST https://api.zinndigital.com/v1/public/chat/{publicKey}/conversations \
-H "Content-Type: application/json" \
-d '{ "message": <string> }'ننوتي یاست؟ ستاسو په ډشبورډ کې د API کنسول ستاسو د اصلي سازمان ID او ستاسو خپله کیلي ډکوي، او غوښتنه د ژوندی API په وړاندې پرمخ وړي ترڅو تاسو وکولی شئ اصلي ځواب وګورئ. دا پای ټکی (endpoint) د 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