2 min read
The Smartrerbot AI API enables the retrieval of knowledge base data for a specified chatbot by sending a GET request to the /chat/Chatbot/ModelList endpoint.
GET
/chat/Chatbot/ModelList
Request URL: https://chat.smarterbot.ai/chat/Chatbot/ModelList
Method: GET
The API request must include the following headers:
Authorization: <Your-Secret-Key>
Content-Type: application/json
const res = await fetch('https://chat.smarterbot.ai/chat/Chatbot/ModelList', { method: 'GET', headers: { "Authorization": "<Your-Secret-Key>", "Content-Type": "application/json"}, body: JSON.stringify({})});const data = await res.json();console.log(data);
import requestsimport jsonurl = 'https://chat.smarterbot.ai/chat/Chatbot/ModelList'headers = { "Authorization": "<Your-Secret-Key>", "Content-Type": "application/json"}data = {}response = requests.get(url, headers=headers, json=data)data = response.json()print(data)
curl 'https://chat.smarterbot.ai/chat/Chatbot/ModelList' \ -X GET \ -H 'Authorization: <Your-Secret-Key>' \ -H 'Content-Type: application/json' \ -d '{}'
GET /chat/Chatbot/ModelList HTTP/1.1Host: chat.smarterbot.aiAuthorization: <Your-Secret-Key>Content-Type: application/json{}
The API response will be a JSON object with the following structure:
{ // array - List of knowledge items "Data": [ { "Key": "2", "Value": "gpt-4o", "Status": true }, { "Key": "3", "Value": "gpt-4o-mini", "Status": true }, { "Key": "22", "Value": "claude-3.5-sonnet", "Status": false }, { "Key": "23", "Value": "claude-3.5-haiku", "Status": false } ], // string - API version "Version": "1.0.0", // boolean - Operation success status "Success": true, // integer - HTTP status code "Code": 200, // string - Error message if any "Message": ""}
If the request fails, you should: 1. Check the HTTP status code for network-level errors 2. Examine the `Code` and `Message` fields in the response for business-level errors 3. The `Message` field will contain detailed error information
Your email address will not be published. Required fields are marked *
Comment *
Name *
Email *
Website
Save my name, email, and website in this browser for the next time I comment.
Post Comment