Skip to Content

Reader Control

See what the user is reading, and move, play or pause it.

See the reader

GET /api/v1/reader needs reader:read.

sourceWhat you get
liveA reader view is open and sharing: the document, the sentence's segmentKey and text, the PDF page, selected text, and playback (playing, paused or preparing)
savedThe last document opened and its saved position

open is reader when a reader view is sharing, library when OpenReader is open on another page, and null otherwise. webUrl opens the reader there. With no document ever opened, the answer is 404 READER_EMPTY.

Move, play or pause

POST /api/v1/reader/commands needs reader:control.

{ "type": "goto", "documentId": "…", "at": "<segmentKey>" }

Opens a document at a sentence from search, chapters or the reader. page picks a PDF page instead, or when the sentence is gone. Playback the user started carries on from there; goto never starts it. From the library it opens the document in that page.

Outcomes

The response is { outcome, webUrl }. For goto, webUrl opens the reader at the target.

outcomeMeaning
doneThe reader did it
sentIt reached the reader, which did not report back within five seconds
not_foundThe sentence or page is not in the document
needs_user_gestureThe browser will not start audio until the user clicks the page
failedThe reader could not do it
not_openNo reader view is sharing

Sharing

Approving an app shares nothing yet. The first call to either endpoint asks the user, in each open OpenReader page, whether to share their reader. The call waits up to 60 seconds. Their answer becomes the default for every app, and they can change it in Connected apps.

AnswerMeaning
409 READER_NEEDS_APPROVALNot answered yet. Ask the user to open OpenReader and answer, then call again.
403 READER_NOT_SHAREDThe default is Keep private and no document is shared
403 DOCUMENT_NOT_SHAREDgoto to a document the user keeps private

A reader view shares only while an app holding a reader scope is connected. A document the user keeps private never appears here, live or saved, and play or pause while it is open answers not_open.

Live reader state is never stored. OpenReader asks the open tabs when an app asks.

On this page

Edit this page