Get a file from inside an EPUB
GET /assets/{id}/epub/resources/{path}
Returns one file from inside an EPUB asset, such as an image,
stylesheet or font. The HTML from GET /assets/{id}/epub/chapters/{idx} already points its links here, so
you don’t normally build these URLs yourself.
Only files listed in the book’s manifest are returned, matched on
their exact path from the start of the archive. Content-Type is
the media type the manifest gives the file, or
application/octet-stream when it gives none; it isn’t checked
against the file. No caching or range headers are sent.
The path must arrive as a single URL segment. The URLs the chapter route writes keep the slashes between folders, so for a file below the top level of the archive they get a 404 instead of the file.
You need to be signed in, and any account can read files from any
EPUB asset. A 400 means the path resolves to the top of the archive
rather than to a file, or contains .. anywhere, even inside a file
name. A 404 means the asset wasn’t found or the file isn’t in the
manifest. Server errors usually get the JSON 500, but some get a
plain-text 500.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The id of the EPUB asset.
The file’s full path inside the archive. Chapter HTML already contains these URLs; files below the top level don’t load through them at the moment (see above).
Responses
Section titled “ Responses ”The file, with the media type from the book’s manifest.
Malformed request
object
Human-readable error summary
Example
the request could not be completedAuthentication required, missing, or invalid
object
Human-readable error summary
Example
the request could not be completedExample
{ "error": "authentication required: sign in and retry with a valid session or API token"}Resource not found
object
Human-readable error summary
Example
the request could not be completedUnexpected server error
object
Human-readable error summary
Example
the request could not be completed