Widget
Embeddable support widget for customer websites.
Script do widget
Seção intitulada “Script do widget”GET /widget.js
Script to include in your website. It injects a floating support button that opens
the ticket form (/widget.html) in an iframe.
<script src="https://exocortex-api.ai-exo-cortex.com/widget.js?tenant=ACME&key=pk_live_3f9a1c2e" async></script>Autenticação: Nenhuma: o pedido é autenticado pela assinatura descrita acima.
Parâmetros
Seção intitulada “Parâmetros”| Nome | Onde | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
tenant |
query | string | sim | |
key |
query | string | sim | Public widget key. |
Respostas
Seção intitulada “Respostas”| Estado | Descrição |
|---|---|
200 |
JavaScript loader. |
Exemplo 200
(function(){ /* exoCortex widget loader */ })();Exemplo com curl
Seção intitulada “Exemplo com curl”curl -X GET "https://exocortex-api.ai-exo-cortex.com/widget.js?tenant=ACME&key=pk_live_3f9a1c2e"Formulário do widget
Seção intitulada “Formulário do widget”GET /widget.html
The HTML form rendered inside the widget iframe. You normally don’t call it directly; /widget.js loads it.
Autenticação: Nenhuma: o pedido é autenticado pela assinatura descrita acima.
Parâmetros
Seção intitulada “Parâmetros”| Nome | Onde | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
tenant |
query | string | sim | |
key |
query | string | sim | Public widget key. |
Respostas
Seção intitulada “Respostas”| Estado | Descrição |
|---|---|
200 |
HTML document. |
Exemplo 200
<!DOCTYPE html><html>…</html>Exemplo com curl
Seção intitulada “Exemplo com curl”curl -X GET "https://exocortex-api.ai-exo-cortex.com/widget.html?tenant=ACME&key=pk_live_3f9a1c2e"Enviar um pedido a partir do widget
Seção intitulada “Enviar um pedido a partir do widget”POST /api/v1/widget/submit
Used by the widget form. Limited to 30 submissions per hour per client IP and tenant.
If the tenant enabled Cloudflare Turnstile, a valid cf_turnstile_token is required.
Autenticação: Chave pública do widget: X-NH-Widget-Key: pk_…
Corpo do pedido
Seção intitulada “Corpo do pedido”application/json
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
tenant |
string | sim | Must match the widget key’s tenant. |
email |
string (email) | sim | |
name |
string | não | |
subject |
string | sim | |
description |
string | sim | |
category |
string | não | |
origin |
string | não | Page URL where the widget was used. |
cf_turnstile_token |
string | não | Cloudflare Turnstile token. Required if the tenant enabled Turnstile. You can also send it in the X-NH-Turnstile header. |
{ "tenant": "ACME", "name": "Maria Rossi", "subject": "Cannot download my invoice", "description": "The invoice page shows an empty PDF for October.", "category": "Billing", "origin": "https://www.example.com/account", "cf_turnstile_token": "0.xY2fake-turnstile-token"}Respostas
Seção intitulada “Respostas”| Estado | Descrição |
|---|---|
200 |
Ticket created. |
400 |
Invalid request. |
401 |
Not authenticated. |
403 |
Authenticated but not allowed (role, tenant or key). |
429 |
Too many submissions from this IP (30 per hour). |
500 |
Unexpected server error. |
Exemplo 200
{ "ok": true, "ticket_key": "ACME-1043", "ingestion_id": "ing_2c71f0aa"}Exemplo com curl
Seção intitulada “Exemplo com curl”curl -X POST "https://exocortex-api.ai-exo-cortex.com/api/v1/widget/submit" \ -H "X-NH-Widget-Key: $EXO_WIDGET_KEY" \ -H "Content-Type: application/json" \ --data '{"tenant":"ACME","email":"[email protected]","name":"Maria Rossi","subject":"Cannot download my invoice","description":"The invoice page shows an empty PDF for October.","category":"Billing","origin":"https://www.example.com/account","cf_turnstile_token":"0.xY2fake-turnstile-token"}'Página gerada a partir da especificação OpenAPI da API de integração, versão 1.1.0.