Get Library Files Details

Retrieve details of files in the Library

To list all files with their details available in the user's Library

GET https://api.knowbase.ai/api/v1/library

Headers

NameTypeDescription

access-token*

string

Required. Your API access token

[
  {
    "id": "file_id",
    "file_name": "example.txt",
    "created_at": "2023-04-01",
    "type": "text",
    "status": "processed",
    "errors": [],
    "summary": "This is a summary.",
    "file_size": 1024,
    "is_public": true
  }
]

Example usage

import requests

# The URL for the library endpoint
url = 'https://api.knowbase.ai/api/v1/library'

# Replace 'your_access_token_here' with the actual access token you received from the API
headers = {
    'access-token': 'your_access_token_here'
}

# Make the GET request to retrieve the library files details
response = requests.get(url, headers=headers)

# Check the response
if response.status_code == 200:
    print("Successfully retrieved the list of files.")
    print(response.json())  # This will print the list of files with their details
else:
    print("Failed to retrieve the list of files.")
    print(response.json())  # This will print the error message

Last updated