Skip to main content
GET
/
knowledge
/
{knowledge_base_id}
/
files
/
{file_id}
/
download_url
Python
from opperai import Opper
import requests

opper = Opper()

# Get a presigned download URL for a file
result = opper.knowledge.get_file_download_url(
    knowledge_base_id="your-kb-id",
    file_id="your-file-id"
)

print(f"Download URL: {result.url}")
print(f"Expires in: {result.expires_in} seconds")

# Download the file
response = requests.get(result.url)
with open("downloaded_file.pdf", "wb") as f:
    f.write(response.content)
{
  "url": "<string>",
  "expires_in": 123
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

knowledge_base_id
string<uuid>
required

The id of the knowledge base

file_id
string<uuid>
required

The id of the file

Response

Successful Response

url
string
required

Presigned URL to download the file

expires_in
integer
required

Number of seconds until the URL expires