Ana içeriğe geç

Widget Ayarları

GET /settings/:id

Widget'ı modellemek için gereken config bilgilerini döner. Tema renkleri, ikonlar, form alanları, zorunlu alanlar ve karşılama mesajları bu yanıttan okunur. JWT gerekmez.

:id parametresi chat uygulamasının UUID'sidir (appId).

İstek

GET /settings/550e8400-e29b-41d4-a716-446655440000 HTTP/1.1
Host: widget-api.chatbot.aithinks.net
const settings = await fetch(`${BASE_URL}/settings/${APP_ID}`)
.then((r) => r.json());

Başarılı yanıt

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"botName": "Destek Botu",
"name": "Müşteri Destek",
"widgetConfigs": {
"requiredFields": ["email"],
"greetingMessages": [
{ "content": "Merhaba! Size nasıl yardımcı olabilirim?" }
],
"primaryBackgroundColor": "#007bff",
"primaryTextColor": "#FFFFFF",
"contentBackgroundColor": "#FFFFFF",
"sentMessageBubbleBgColor": "#007bff",
"sentMessageBubbleTextColor": "#FFFFFF",
"receivedMessageBubbleBgColor": "#f1f1f1",
"receivedMessageBubbleTextColor": "#000000",
"aiIconUrl": "https://cdn.example.com/bot-icon.png",
"widgetIconUrl": "https://cdn.example.com/widget-icon.png"
}
}

Alanlar

AlanTipAçıklama
idstring (UUID)Chat uygulaması kimliği
botNamestringBotun görünen adı
namestringChat uygulaması başlığı
widgetConfigsobjectWidget'ı modellemek için config (tema, form, karşılama)

widgetConfigs anahtarları

AnahtarTipAçıklama
requiredFieldsstring[]Ziyaretçi kaydı body'sinde zorunlu alan adları
greetingMessages{ content: string }[]Kayıt sonrası sohbete eklenen karşılama mesajları
formInputsstring[]Formda gösterilecek alanlar (ör. firstName, lastName, email)
primaryBackgroundColorstringAna renk
primaryTextColorstringAna metin rengi
inputTextColor / inputBackgroundColorstringGiriş alanı renkleri
footerBackgroundColor / contentBackgroundColorstringFooter ve içerik arka planı
sentMessageBubbleBgColor / sentMessageBubbleTextColorstringZiyaretçi balonu renkleri
receivedMessageBubbleBgColor / receivedMessageBubbleTextColorstringBot/agent balonu renkleri
formBackgroundColorstringForm arka planı
aiIconUrl / widgetIconUrl / userIconUrlstringİkon URL'leri

widgetConfigs içeriği uygulamaya göre değişebilir; bilinmeyen anahtarları yok sayın.

Hatalar

DurumAnlamı
404Verilen id ile chat uygulaması bulunamadı