Integration
External Systems
import requests
import json
# Authenticate
auth_response = requests.post(
"http://localhost:8000/token",
data={"username": "user@example.com", "password": "secure_password"}
)
token = auth_response.json()["access_token"]
# Upload document
with open("document.pdf", "rb") as f:
files = {"file": ("document.pdf", f, "application/pdf")}
headers = {"Authorization": f"Bearer {token}"}
response = requests.post(
"http://localhost:8000/documents/ingest",
files=files,
headers=headers
)
document_id = response.json()["id"]
# Process document
chunking_response = requests.post(
"http://localhost:8000/chunks/document",
json={"document_id": document_id},
headers={"Authorization": f"Bearer {token}"}
)Authentication Integration
Last updated
Was this helpful?

