Knowledge Base API Documentation
GET: Retrieve Knowledge Base
Description
This route is used to retrieve a list of all the questions and answers for a specific project.
Method
GET
Query Parameters
sort
(string): The field by which to sort the Knowledge base.page
(number): The page number of the results.limit
(number): The number of items per page.searchTerm
(string): Optional search term to filter Knowledge base.
Response
- Returns a JSON response with the list of Knowledge base or an error message.
Status Codes
200 OK
: Knowledge Base retrieved successfully.500 Internal Server Error
: Error listing Knowledge Base.
Throws
- An error if request validation or Knowledge base retrieval fails.
Example cURL
curl --location 'https://app.ai12z.net/api/projects/{projectId}/kb' \
--header 'Authorization: Bearer <YOUR_KEY>'
--data-urlencode 'sort=name' \
--data-urlencode 'page=1' \
--data-urlencode 'limit=10'
GET: Retrieve Knowledge Base by ID
Description
This route is used to retrieve details of a specific Knowledge base by its ID.
Method
GET
URL Parameters
id
(string): The ID of the Knowledge base to retrieve.
Response
- Returns a JSON response with Knowledge base details such as
id
,question
,answer
,imageDescription
,imageurl
andimageCaption
.
Status Codes
200 OK
: Knowledge base retrieved successfully.500 Internal Server Error
: Error retrieving the Knowledge Base.
Throws
- An error if the Knowledge Base is not found or any other error occurs.
Example cURL
curl --location 'https://app.ai12z.net/api/projects/{projectId}/kb' \
--header 'Authorization: Bearer <YOUR_KEY>'