Download Content
GET /api/v2/content/{issue_id}/download
Returns metadata and file URLs needed to download content for offline reading. The response structure varies by content type.
Request:
curl https://app.publica.la/api/v2/content/440317/download \
-H "Authorization: Bearer {access_token}" \
-H "X-Farfalla-Tenant-Id: 42" \
-H "Accept: application/json"
Response: 200 OK
{
"id": 440317,
"name": "Book Title",
"description": "Book description...",
"slug": "book-slug",
"published_at": {
"timestamp": 1606186800,
"date": "2020-11-24 03:00:00",
"timezone": "+00:00"
},
"table_of_contents": [],
"user_can_read": true,
"file_type": "epub",
"reader_url": "https://planeta.publica.la/reader/book-slug",
"cover": "https://cdn.publica.la/issues/cover.jpg",
"thumbnail": "https://cdn.publica.la/issues/thumb.jpg",
"url": "https://cdn.publica.la/issues/v1/",
"file_url": "https://proxy.publica.la/epub/abc123",
"packed_file_url": "https://proxy.publica.la/epub/abc123",
"tracks": null,
"files_urls": null,
"articles": [],
"payment_links": null,
"prices": { "USD": 9.99 },
"author": "Author Name",
"pages": null,
"number_of_pages": 250,
"external_id": "9786599001772",
"private_material": null,
"access_expires_at": null,
"require_login": 0,
"free": false
}
File URLs by Content Type
| Content Type | Fields Used |
|---|---|
| EPUB | packed_file_url, file_url |
files_urls (array of page URLs) | |
| Audiobook | tracks (array of track objects) |
See issue-file-manager.ts > performDownload() in the Fenice codebase for how these fields are consumed.
warning
The access_expires_at field (format: YYYY-MM-DD HH:mm:ss) indicates when offline access expires. The app should deny access to downloaded content after this date.