Skip to content
Skip to Content
DevelopersAPI referenceItems

Save where the caller stopped reading an item

PUT
/v1/items/{id}/progress

Replaces the caller's place in the item (the last save wins; anchor, percent and progress left out are cleared). Send offset, progress or both. progress (0 to 1) and percent (0 to 100) are one measure: the one you leave out is derived from the other. With progress and no offset, the offset is that fraction of the item's text, so a client that reads offsets lands in the same place. Clients should debounce saves (a few seconds after scrolling stops). A re-crawl that replaces the item's text clears every reader's place. Allowed while the library is read-only over its plan's limits. An API key needs write access to items.

Authorization

bearer
headerAuthorizationBearer <token>

A personal API key (ga_…), sent as Authorization: Bearer ga_…. A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Path Parameters

id*string

Request Body

application/json
  1. body
offset*integer
Range0 <= value
progress?number

Fraction of the item read.

Range0 <= value <= 1
anchor?string

Blank is saved as null.

Lengthlength <= 500
percent?integer
Range0 <= value <= 100

Response Body

Saved

application/json
  1. response
item_id*string
offset*integer

Character offset into the item's text. 0 when nothing was saved.

Range0 <= value
anchor*|

A short passage at the offset, to find the place again if the text changes.

Lengthlength <= 500
percent*|
Range0 <= value <= 100
progress*|

How far through the item the reader is, as a fraction. The same measure as percent, kept at full precision; null when the client that saved the place sent neither.

Range0 <= value <= 1
updated_at*|

When it was saved; null when it never was.

Formatdate-time
Example Request
curl -X PUT 'https://example.com/v1/items/string/progress' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "item_id": "string",  "offset": 0,  "anchor": "string",  "percent": 0,  "progress": 0,  "updated_at": "2019-08-24T14:15:22Z"}