public
POST /v1/public/chat/{publicKey}/conversations
A visitor says something for the first time.
प्रमाणीकरण
हा एंडपॉइंट सार्वजनिक आहे. याला कोणतीही क्रेडेन्शियल आणि कोणतेही ऑर्गनायझेशन लागत नाही — हे तेच आहे जे आमची स्वतःची मार्केटिंग साइट आणि AI आन्सर इंजिने वाचतात.
या एंडपॉइंटला कोणतीही संस्था आयडी (organisation id) लागत नाही. तुमची की (key) आधीच ती कोणत्या संस्थेशी संबंधित आहे हे ओळखते आणि प्रतिसाद त्यानुसार मर्यादित केला जातो.
प्रयत्न करा
कोनसांस्कृतिक कंसात (<>) असलेली कोणतीही गोष्ट तुमच्या स्वतःच्या मूल्यांनी बदला आणि key प्लेसहोल्डरला तुमच्या डॅशबोर्डवरील किने बदला.
curl -X POST https://api.zinndigital.com/v1/public/chat/{publicKey}/conversations \
-H "Content-Type: application/json" \
-d '{ "message": <string> }'साइन इन केलेले आहे? तुमच्या डॅशबोर्डमधील 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