Skip to main content

Obtain Basic Knowledge

The API for fetching models from app.neoagent.co provides the functionality to create a new chatbot by sending a POST request to the endpoint /chat/Chatbot/GetSource.

Endpoint

Request URL: https://app.neoagent.co/chat/Chatbot/GetSource
Method: POST

Request Body

The request body must contain the following parameters:

{
// string, required - The unique identifier (ID) of the chatbot
"serialNumber": "3254a9d0424c4806b9ea3d0763xxxxxx"
}

Parameters

  • serialNumber - string, required - The unique identifier (ID) of the chatbot to delete

Required Headers

The API request must include the following headers:

  • Authorization: <Your-Secret-Key> - string, required - The secret key to authenticate the API request
  • Content-Type: application/json - string, required - The content type of the request payload (must be application/json)

Request Examples

const res = await fetch('https://app.neoagent.co/chat/Chatbot/GetSource', {
method: 'POST',
headers: {
"Authorization": "<Your-Secret-Key>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"serialNumber": "3254a9d0424c4806b9ea3d0763xxxxxx"
})
});

const data = await res.json();
console.log(data);

Response

The API response will be a JSON object with the following structure:

{
// array - List of knowledge items
"Data": [
{
"Type": "FileList",
"Name": "34321",
"Value": "FAQ_0403.txt",
"Length": 12043,
"Status": 2,
"StatusMessage": "Succeeded",
"ID": 377631,
"SourceLink": ""
},
{
"Type": "CompanyInfo",
"Name": "CompanyInfo",
"Value": "",
"Length": 286,
"Status": 2,
"StatusMessage": "Succeeded",
"ID": 377634,
"SourceLink": ""
},
{
"Type": "UrlList",
"Name": "www.example.com",
"Value": "",
"Length": 0,
"Status": 3,
"StatusMessage": "Failed",
"ID": 377635,
"SourceLink": "www.example.com"
},
{
"Type": "Text",
"Name": "111111111",
"Value": "",
"Length": 9,
"Status": 2,
"StatusMessage": "Succeeded",
"ID": 377636,
"SourceLink": ""
},
{
"Type": "QAList",
"Name": "Question",
"Value": "Answer",
"Length": 9,
"Status": 2,
"StatusMessage": "Succeeded",
"ID": 377627,
"SourceLink": ""
}
],
// 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": ""
}

Error Handling

If the request fails, you should:

  1. Check the HTTP status code for network-level errors
  2. Inspect the Code and Message fields in the response for business-level errors
  3. The Message field will contain detailed information about the error