Knowbase
HomeSign In
  • Welcome to Knowbase.ai API
  • Quick Start
  • Reference
    • Upload File
    • Get Library Files Details
    • Chat with file by File ID
    • Get Text File Summary
    • Delete File
Powered by GitBook
On this page
  • To list all files with their details available in the user's Library
  • Example usage
  1. Reference

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

Name
Type
Description

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
  }
]

{
  "error": "string"
}

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
PreviousUpload FileNextChat with file by File ID

Last updated 1 year ago