live-chat
PATCH /v1/chat/widgets/{widgetId}
Change a chat's settings, or switch it on.
認証
ベアラー トークンとして API キーを送信します。キーには livechat.manage 権限が付与されている必要があります。権限のないキーは 404 ではなく 403 で拒否されます。
このエンドポイントは組織IDを受け付けません。お使いのキーによって所属する組織がすでに特定されており、レスポンスはその組織にスコープされます。
試してみる
アングルブラケット内のすべてをご自身の値に置き換え、キーのプレースホルダーをご利用中のダッシュボードのキーに置き換えてください。
curl -X PATCH https://api.zinndigital.com/v1/chat/widgets/{widgetId} \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'ログインしていますか?ダッシュボード内のAPIコンソールでは、実際の組織IDやお客様ご自身のキーが自動入力され、ライブAPIに対してリクエストが実行されるため、実際のレスポンスを確認することができます。 API コンソールでこのエンドポイントを開く
詳細
Requires livechat.manage. Switching a widget on with no allowedOrigins is refused with 422 rather than accepted: the widget only answers pages on origins the customer listed, so an empty list would leave the chat live, looking configured, and invisible on every page with nothing saying why.
パラメータ
| 名前 | タイプ | 必須 | これがその内容です |
|---|---|---|---|
widgetId (path) | string | はい | — |
リクエスト本文
| 名前 | タイプ | 必須 | これがその内容です |
|---|---|---|---|
name | string | いいえ | — |
enabled | boolean | いいえ | — |
allowed_origins | string[] | いいえ | — |
greeting | string | いいえ | — |
team_name | string | いいえ | — |
accent_colour | string | いいえ | — |
position | string<left, right> | いいえ | — |
hide_branding | boolean | いいえ | — |
ai_enabled | boolean | いいえ | — |
offline_email | string | いいえ | — |
business_hours | object | いいえ | — |
返信
| 名前 | タイプ | 必須 | これがその内容です |
|---|---|---|---|
id | string | はい | — |
site_id | string | はい | — |
name | string | はい | — |
public_key | string | はい | — |
enabled | boolean | はい | Whether the chat renders. Created FALSE always: the plugin ships in the deploy footprint of every WordPress site we host, so a widget may exist for a customer who never asked for… |
allowed_origins | string[] | はい | Origins the widget may be embedded on. An EMPTY list refuses every page rather than allowing any — this is the only control stopping somebody else's site opening conversations… |
tier | string | はい | The tier this widget is EFFECTIVELY on. Premium is included free with Zinn® hosting, so this may read premium on a widget nobody has paid for — read purchased_tier for what… |
tier_source | string<free, purchase, hosting> | はい | Why the widget is on that tier. hosting means it is included with the customer's Zinn® hosting and there is nothing to buy; purchase means the Premium extra was bought for… |
purchased_tier | string | はい | The tier actually PAID for, independent of any hosting inclusion. |
greeting | string | はい | — |
team_name | string | はい | — |
accent_colour | string | はい | — |
position | string<left, right> | はい | — |
hide_branding | boolean | はい | — |
ai_enabled | boolean | はい | — |
offline_email | string | はい | — |
business_hours | object | いいえ | — |
open_now | boolean | はい | — |
ai_allowance | ChatAiAllowance | はい | — |
limits | object | はい | — |
premium_extra_code | string | はい | The catalogue code to buy for the premium tier. |
このエンドポイントが返すエラー
401 · 403 · 404 · 422