public
POST /v1/public/chat/{publicKey}/conversations
A visitor says something for the first time.
توثيقِ شناخت
یہ اینڈ پوائنٹ عوامی ہے۔ یہ کوئی اسناد اور کوئی تنظیم نہیں لیتا — یہ وہ ہے جسے ہماری اپنی مارکیٹنگ سائٹ اور AI کے جواب دینے والے انجن پڑھتے ہیں۔
یہ اینڈ پوائنٹ کوئی آرگنائزیشن آئی ڈی نہیں لیتا۔ آپ کی کلید پہلے ہی اس آرگنائزیشن کی شناخت کرتی ہے جس سے یہ تعلق رکھتی ہے، اور اس کا جواب اسی کے مطابق محدود ہوتا ہے۔
آزمائیں
کوئی بھی چیز جو زاویہ دار قوسین میں ہو اسے اپنی اقدار سے بدلیں، اور کلیدی پلیس ہولڈر کو اپنے ڈیش بورڈ کی کسی کلید سے بدلیں۔
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… |
درخواست کا باڈی
| نام | قسم | لازمی | یہ کیا ہے |
|---|---|---|---|
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