- ๐ ๏ธ API Contracts
- Knowledge Base API reference
- Knowledge Base API
const url = 'https://api.amitysolutions.com/api/v1/knowledge/1';const options = { method: 'PUT', headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'}, body: '{"name":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.amitysolutions.com/api/v1/knowledge/1 \ --header 'Content-Type: application/json' \ --header 'x-api-key: <x-api-key>' \ --data '{ "name": "example" }'Authorizations
Section titled โAuthorizationsโParameters
Section titled โ Parameters โPath Parameters
Section titled โPath ParametersโKnowledge Base ID
Request Body
Section titled โRequest Bodyโobject
The name of the knowledge
Max file name length: 255 characters
Examplegenerated
{ "name": "example"}Responses
Section titled โ Responses โUpdated knowledge base
object
Numeric ID of the knowledge
The name of the knowledge
Type of knowledge base. internal will search the content from uploaded files and external will send a request to target endpoint for search.
List of supported languages for the knowledge. Files uploaded to this knowledge will have a copy of the document with each supported language translated.
Search endpoint for external knowledge bases
If set to true, search will use semantic search on top of full-text search.
Timestamp of creation for knowledge
Last updated timestamp for knowledge
Example
{ "source": "internal", "supportedLanguages": [ "en" ], "createdAt": "2023-11-09T00:00:00.000Z", "updatedAt": "2023-11-09T00:00:00.000Z"}Unauthorized Error. ASAP will return this error when there is either no api key, invalid api key or the client`s IP address is not whitelisted.
object
object
Example
{ "name": "UnauthorizedException", "code": 401001, "status": 401, "message": "Unauthorized", "errors": []}Knowledge base not found
object
Name of the error
ASAP platform specific error code
HTTP status code
Error message details
object
Example
{ "name": "NotFoundException", "code": 404001, "status": 404, "message": "Knowledge base with specified ID not found.", "errors": []}Validation Error
object
Name of the error
ASAP platform specific error code
HTTP status code
Error message details
object
Type of error
Name of the field having the error
Input value
Error message
Example
{ "name": "UnprocessableEntityException", "code": 422001, "status": 422, "message": "request payload validation failed", "errors": [ { "type": "isNotEmpty", "field": "name", "message": "name must not be empty" }, { "type": "min", "field": "limit", "value": -1, "message": "limit must not be less than 1" } ]}Too Many Requests
object
Name of the error
ASAP platform specific error code
HTTP status code
Error message details
object
Example
{ "name": "RateLimitExceededException", "code": 429001, "status": 429, "message": "Rate limit exceeded", "errors": []}Was this page helpful?
Thank you for your feedback!