Skip to content

Find how to read a chapter from a source

GET
/api/v1/me/extensions/{extensionId}/content
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.

extensionId
required
string

The extension’s reverse-DNS id.

chapterId
required
string

The source’s own chapter id.

How to read the chapter. Kept for ten minutes, since page links expire.

Media typeapplication/json

How to read a chapter. Exactly one of pages and file is set.

object
format
required

How a source’s chapter is read: images are pages read like a comic, epub and pdf are one file.

string
Allowed values: images epub pdf
pages
required

Set when format is images, as listRemotePages answers.

Array<object> | null
object
index
required
integer
url
required

A path on this server, relative to its base URL, that serves the image.

string
file
required
One of:

A chapter that’s one file, such as a book.

object
id
required

The source’s own id for the file. A different file has a different id, so a client may keep a download under it.

string
mediaType
required
string
Allowed values: application/epub+zip application/pdf
url
required

A path on this server, relative to its base URL, that serves the file.

string
size
required

The file’s size in bytes, when the source knows.

integer | null format: int64
fileName
required

A name to save it under.

string | null
rights
required
One of:

What the source says about an openly licensed publication’s terms. Show them with the publication; null fields the source doesn’t give.

object
license
required

An SPDX identifier, such as CC-BY-4.0, or the license’s name.

string | null
licenseUrl
required

An HTTPS link to the license’s text.

string | null format: uri
attribution
required

The credit the license asks for, as the source words it.

string | null
sourceUrl
required

An HTTPS link to the publication’s page on the source.

string | null format: uri

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.

Media typeapplication/json
object
code
required
string
Allowed values: bad_request unauthorized forbidden not_found unavailable scan_in_progress content_changed already_set_up name_taken last_admin progress_conflict too_many_attempts not_linked identity_taken last_sign_in provider_unavailable too_many_sign_ins repository_exists repository_not_allowed repository_unreadable repository_needs_token repository_needs_password repository_needs_credentials repository_credentials_refused extension_invalid source_failed source_unavailable source_check_failed internal
message
required

Explains the problem to a developer.

string

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.

Media typeapplication/json
object
code
required
string
Allowed values: bad_request unauthorized forbidden not_found unavailable scan_in_progress content_changed already_set_up name_taken last_admin progress_conflict too_many_attempts not_linked identity_taken last_sign_in provider_unavailable too_many_sign_ins repository_exists repository_not_allowed repository_unreadable repository_needs_token repository_needs_password repository_needs_credentials repository_credentials_refused extension_invalid source_failed source_unavailable source_check_failed internal
message
required

Explains the problem to a developer.

string

Example

{
"code": "bad_request"
}

The resource does not exist.

Media typeapplication/json
object
code
required
string
Allowed values: bad_request unauthorized forbidden not_found unavailable scan_in_progress content_changed already_set_up name_taken last_admin progress_conflict too_many_attempts not_linked identity_taken last_sign_in provider_unavailable too_many_sign_ins repository_exists repository_not_allowed repository_unreadable repository_needs_token repository_needs_password repository_needs_credentials repository_credentials_refused extension_invalid source_failed source_unavailable source_check_failed internal
message
required

Explains the problem to a developer.

string

Example

{
"code": "bad_request"
}

The server failed; details are in its log.

Media typeapplication/json
object
code
required
string
Allowed values: bad_request unauthorized forbidden not_found unavailable scan_in_progress content_changed already_set_up name_taken last_admin progress_conflict too_many_attempts not_linked identity_taken last_sign_in provider_unavailable too_many_sign_ins repository_exists repository_not_allowed repository_unreadable repository_needs_token repository_needs_password repository_needs_credentials repository_credentials_refused extension_invalid source_failed source_unavailable source_check_failed internal
message
required

Explains the problem to a developer.

string

Example

{
"code": "bad_request"
}

The extension reported an error, went over a limit, or the image couldn’t be fetched.

Media typeapplication/json
object
code
required
string
Allowed values: bad_request unauthorized forbidden not_found unavailable scan_in_progress content_changed already_set_up name_taken last_admin progress_conflict too_many_attempts not_linked identity_taken last_sign_in provider_unavailable too_many_sign_ins repository_exists repository_not_allowed repository_unreadable repository_needs_token repository_needs_password repository_needs_credentials repository_credentials_refused extension_invalid source_failed source_unavailable source_check_failed internal
message
required

Explains the problem to a developer.

string

Example

{
"code": "bad_request"
}