Find how to read a chapter from a source
const url = 'http://localhost:8080/api/v1/me/extensions/example/content?chapterId=example';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'http://localhost:8080/api/v1/me/extensions/example/content?chapterId=example' \ --header 'Authorization: Bearer <token>'A chapter’s pages, the same as listRemotePages, or a link to its file for a source of books, such as an EPUB or PDF, with the license and source page the source gives. Use format to pick a reader, never the URL. Sources from before formats existed always answer pages.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The extension’s reverse-DNS id.
Query Parameters
Section titled “Query Parameters”The source’s own chapter id.
Responses
Section titled “Responses”How to read the chapter. Kept for ten minutes, since page links expire.
How to read a chapter. Exactly one of pages and file is set.
object
How a source’s chapter is read: images are pages read like a comic, epub and pdf are one file.
Set when format is images, as listRemotePages answers.
object
A path on this server, relative to its base URL, that serves the image.
A chapter that’s one file, such as a book.
object
The source’s own id for the file. A different file has a different id, so a client may keep a download under it.
A path on this server, relative to its base URL, that serves the file.
The file’s size in bytes, when the source knows.
A name to save it under.
What the source says about an openly licensed publication’s terms. Show them with the publication; null fields the source doesn’t give.
object
An SPDX identifier, such as CC-BY-4.0, or the license’s name.
An HTTPS link to the license’s text.
The credit the license asks for, as the source words it.
An HTTPS link to the publication’s page on the source.
Example
{ "format": "images", "pages": [ { "url": "/api/v1/me/extensions/org.example.comics/image?ref=eyJ1cmwiOi" } ], "file": { "mediaType": "application/epub+zip", "url": "/api/v1/me/extensions/org.example.books/file?ref=eyJpZCI6" }, "rights": { "license": "Public domain in the USA" }}The request has no valid session token.
object
Explains the problem to a developer.
Example
{ "code": "bad_request"}The signed-in user may not do this. demo_account when the user is a
shared demo account, named in CHEK_DEMO_USERS, which can’t change
its password, sessions, sign-in providers, extensions or annotations.
object
Explains the problem to a developer.
Example
{ "code": "bad_request"}The resource does not exist.
object
Explains the problem to a developer.
Example
{ "code": "bad_request"}The server failed; details are in its log.
object
Explains the problem to a developer.
Example
{ "code": "bad_request"}The extension reported an error, went over a limit, or the image couldn’t be fetched.
object
Explains the problem to a developer.
Example
{ "code": "bad_request"}