The Box connector is a text connector for Box file storage. It lists items
in a folder, downloads file content, and ingests claims via db.ingest_text().
Supports file type filtering to process only the document types you need.
api.box.com/2.0) with Bearer token auth"0")/files/{id}/content endpointpdf, docx, txt)db.ingest_text()Box supports developer tokens (short-lived, for testing) and OAuth 2.0 tokens (for production). Developer tokens expire after 60 minutes. For long-running use, set up a Box application with OAuth 2.0 and use a refresh token flow.
Go to the Box Developer Console,
create a new app, and generate a Developer Access Token. For production use,
configure OAuth 2.0 with the base_explorer scope.
$ pip install requests
conn = db.connect("box", token=os.environ["BOX_TOKEN"], ) result = conn.run(db)
| Parameter | Required | Default | Description |
|---|---|---|---|
token |
Yes | — | Box API access token (developer token or OAuth) |
folder_id |
No | "0" |
Box folder ID (default "0" = root folder) |
max_files |
No | 50 |
Maximum number of files to process |
file_types |
No | All types | List of file extensions to include (e.g. ["pdf", "docx", "txt"]) |
extraction |
No | heuristic |
Text extraction mode: heuristic or llm |
save |
No | False |
Encrypt and persist token |
conn = db.connect("box", token=os.environ["BOX_TOKEN"], ) result = conn.run(db) print(f"Ingested {result.claims_ingested} claims from {result.files_processed} files")
conn = db.connect("box", token=os.environ["BOX_TOKEN"], file_types=["pdf", "docx", "txt"], max_files=100, extraction="llm", ) result = conn.run(db)
conn = db.connect("box", token=os.environ["BOX_TOKEN"], folder_id="123456789", save=True, ) result = conn.run(db)