live-chat
PATCH /v1/chat/widgets/{widgetId}
Change a chat's settings, or switch it on.
Πισtoποίηση
Στείλτε ένα κλειδί API ως διακριτικό φορέα (bearer token). Το κλειδί πρέπει να διαθέτει το δικαίωμα livechat.manage· ένα κλειδί που δεν το διαθέτει απορρίπτεται με 403, όχι 404.
Αυτό το τελικό σημείο δεν δέχεται αναγνωριστικό οργανισμού. Το κλειδί σας προσδιορίζει ήδη τον οργανισμό στον οποίο ανήκει, και η απάντηση περιορίζεται σε αυτόν.
Δοκιμάστε το
Ατικatastήstε ό,τι βρίskεtai μέσα σe γώniaδeς μe τis δikές sas timές, kai to placeholder klεidioύ μe éna klεidi apó ton pinaka ελέgchou sas.
curl -X PATCH https://api.zinndigital.com/v1/chat/widgets/{widgetId} \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Συνδεθήκατε; Η κονσόλα API στον πίνακα ελέγχου σας συμπληρώνει το πραγματικό αναγνωριστικό του οργανισμού σας και το δικό σας κλειδί, και εκτελεί το αίτημα στο ζωντανό 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.
Παράμετροι
| Όνομα | Τύpος | Υποχρεωτικό | Τι είναι |
|---|---|---|---|
widgetId (path) | string | Ναι | — |
Σώμα αίτησης
| Όνομα | Τύpος | Υποχρεωτικό | Τι είναι |
|---|---|---|---|
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 | Όχι | — |
Απάντηση
| Όνομα | Τύpος | Υποχρεωτικό | Τι είναι |
|---|---|---|---|
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