Bufdir PDF Generator
API Contract
REST
/api/v1/bufdir-pdf
3 endpoints
POST
/api/v1/bufdir-pdf/api/v1/bufdir-pdf
Generate a PDF report from mapped rows
Public
Request Example
{
"export_id": "exp-20260326-xyz789",
"rows": [
{
"Aktivitetstype": "group_session",
"Dato": "2025-06-15",
"Antall deltakere": 8
}
],
"metadata": {
"org_name": "Organisasjon Sør",
"org_id": "org-bufdir-042",
"period": "2025",
"generated_by": "Kari Nordmann",
"generated_at": "2026-03-26T10:00:00Z"
},
"template": "standard_annual"
}
Response Example
{
"export_id": "exp-20260326-xyz789",
"file_name": "bufdir-rapport-2025-org-bufdir-042.pdf",
"file_size_bytes": 1048576,
"page_count": 12,
"generation_ms": 3200
}
GET
/api/v1/bufdir-pdf/api/v1/bufdir-pdf/:export_id/download
Download generated PDF bytes
Public
Response Example
Binary file stream (Content-Type: application/pdf)
GET
/api/v1/bufdir-pdf/api/v1/bufdir-pdf/:export_id/info
Get PDF metadata (page count, size) without downloading
Public
Response Example
{
"export_id": "exp-20260326-xyz789",
"file_name": "bufdir-rapport-2025-org-bufdir-042.pdf",
"file_size_bytes": 1048576,
"page_count": 12,
"template": "standard_annual"
}