LogoLogo
註冊/登入
  • 使用者手冊
  • 技術人員手冊
  • API 文件
  • AI 助理市集
  • 首頁
  • AI 助理
  • 附件與檔案
  • 知識庫
  • 對話與訊息
  • 對話 Widget
  • 組織與成員
  • 角色與權限
Powered by GitBook
On this page

Was this helpful?

對話 Widget

取得特定 Web Chat

GET /api/web-chats/{id}/

參數

參數名稱
必填
類型
說明

id

✅

string

A UUID string identifying this web chat.

程式碼範例

# 呼叫 API 示例 (Shell)
curl -X GET "https://api.maiagent.ai/api/web-chats/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
const axios = require('axios');

// 設定請求標頭
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/web-chats/550e8400-e29b-41d4-a716-446655440000/", config)
  .then(response => {
    console.log('成功取得回應:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('請求發生錯誤:');
    console.error(error.response?.data || error.message);
  });
import requests

url = "https://api.maiagent.ai/api/web-chats/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("成功取得回應:")
    print(response.json())
except Exception as e:
    print("請求發生錯誤:", e)
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/web-chats/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "成功取得回應:\n";
    print_r($data);
} catch (Exception $e) {
    echo '請求發生錯誤: ' . $e->getMessage();
}
?>

回應內容

狀態碼: 200

回應結構範例

{
  "id": string (uuid)
  "name": string
  "avatar"?: string (uri) // 非必填
  "logo"?: string (uri) // 非必填
  "description"?: string // 非必填
  "cover"?: string (uri) // 非必填
  "backUrl"?: string // 非必填
  "isActive"?: boolean // 非必填
  "enableSpeech": boolean
  "displayGreeting": string
  "displayConversationStarters": [
    string
  ]
  "theme": 
  {
    "primaryColor"?: string // 非必填
    "dialogColor"?: string // 非必填
    "navbarTextColor"?: string // 非必填
  }
  "darkTheme": 
  {
    "primaryColor"?: string // 非必填
    "dialogColor"?: string // 非必填
    "navbarTextColor"?: string // 非必填
  }
  "enableFileUpload"?: boolean // 非必填
  "enableDisplayCitations"?: boolean // 非必填
  "enableDisplayToolResults"?: boolean // 非必填
  "enableShareConversation"?: boolean // 非必填
  "enableLocation"?: boolean // 非必填
  "enableShowPoweredBy"?: boolean // 非必填
  "accessType": object
  "enableThemeModeToggle"?: boolean // 非必填
  "defaultThemeMode"?: object // 非必填
  "enableDownloadCitations"?: boolean // 非必填
  "inbox": object
}

回應範例值

{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "測試 doc",
  "avatar": "https://example.com/static/images/default-chatbot-avatar.png",
  "logo": null,
  "description": "",
  "cover": null,
  "backUrl": "",
  "isActive": true,
  "enableSpeech": false,
  "displayGreeting": null,
  "displayConversationStarters": [],
  "theme": {
    "primaryColor": "#3854d8",
    "dialogColor": "#ddeaf6",
    "navbarTextColor": "#ffffff"
  },
  "enableFileUpload": true,
  "enableDisplayCitations": true,
  "enableShareConversation": false,
  "enableLocation": false,
  "enableShowPoweredBy": true,
  "accessType": "web",
  "inbox": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "測試 doc",
    "signAuth": {
      "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
      "signSource": {
        "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
        "accessType": "keycloak"
      },
      "signParams": {
        "keycloak": {
          "url": "example.com",
          "realm": "example",
          "clientId": "example"
        }
      }
    }
  }
}

Previous對話與訊息Next組織與成員

Last updated 27 days ago

Was this helpful?