public
POST /v1/public/chat/{publicKey}/conversations
A visitor says something for the first time.
認証
このエンドポイントは公開されています。認証情報や組織情報は不要で、当社のマーケティングサイトやAI回答エンジンが読み取っているものと同じです。
このエンドポイントは組織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… |
リクエスト本文
| 名前 | タイプ | 必須 | これがその内容です |
|---|---|---|---|
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