Skip to content

A novel's quiz, one page. The answer is withheld unless asked for.

GET
/api/v1/novels/{id}/questions
curl --request GET \
--url https://api.utmelab.com/api/v1/novels/example/questions \
--header 'X-API-Key: <X-API-Key>'
id
required
string

Novel id, e.g. lekki.

chapter
integer | null format: int32

Drill one chapter.

include_explanation
boolean | null

Include the answer and the working. Default: false.

page
integer | null format: int32

1-based page. Default: 1.

per_page
integer | null format: int32

Rows per page, clamped. Default: 50, cap: 200.

Media typeapplication/json

One page of a collection in the shape every paged endpoint serves. The envelope lives here, once, so a new paged endpoint cannot re-derive the counts: total_pages comes from total_records and per_page through [Page::new], never from the call site.

The collection field is questions because both surfaces that page today page questions; a future non-question page renames it there.

object
includes_explanation
required
boolean
page
required
integer format: int32
passages
object | null
per_page
required
integer format: int32
questions
required
Array<object>

One novel quiz row as served. novel_id is stamped by the caller. The stored row does not carry it.

object
answer
string | null
chapter_number
integer | null format: int32
explanation
One of:

Why the answer is what it is: teaser, working, and the distractor that catches people.

object
body
required

Plain text plus offset marks. text stays searchable as characters; structure rides in inline as Unicode-scalar offsets, never bytes.

object
inline
required
Array

One offset mark. Serialised flat with an adjacent kind tag, e.g. {"start":24,"len":6,"kind":"underline"}.

object
One of:
object
kind
required
string
Allowed values: bold
len
required

Length in Unicode scalar values. Zero for an image anchor, which marks an attachment point rather than a span.

integer format: int32
start
required

Offset in Unicode scalar values from the start of text.

integer format: int32
text
required
string
key_point
required

Plain text plus offset marks. text stays searchable as characters; structure rides in inline as Unicode-scalar offsets, never bytes.

object
inline
required
Array

One offset mark. Serialised flat with an adjacent kind tag, e.g. {"start":24,"len":6,"kind":"underline"}.

object
One of:
object
kind
required
string
Allowed values: bold
len
required

Length in Unicode scalar values. Zero for an image anchor, which marks an attachment point rather than a span.

integer format: int32
start
required

Offset in Unicode scalar values from the start of text.

integer format: int32
text
required
string
trap
One of:

Plain text plus offset marks. text stays searchable as characters; structure rides in inline as Unicode-scalar offsets, never bytes.

object
inline
required
Array

One offset mark. Serialised flat with an adjacent kind tag, e.g. {"start":24,"len":6,"kind":"underline"}.

object
One of:
object
kind
required
string
Allowed values: bold
len
required

Length in Unicode scalar values. Zero for an image anchor, which marks an attachment point rather than a span.

integer format: int32
start
required

Offset in Unicode scalar values from the start of text.

integer format: int32
text
required
string
id
required
string
novel_id
required
string
options
required
Array<object>
object
id
required
string
text
required

Plain text plus offset marks. text stays searchable as characters; structure rides in inline as Unicode-scalar offsets, never bytes.

object
inline
required
Array

One offset mark. Serialised flat with an adjacent kind tag, e.g. {"start":24,"len":6,"kind":"underline"}.

object
One of:
object
kind
required
string
Allowed values: bold
len
required

Length in Unicode scalar values. Zero for an image anchor, which marks an attachment point rather than a span.

integer format: int32
start
required

Offset in Unicode scalar values from the start of text.

integer format: int32
text
required
string
text
required

Plain text plus offset marks. text stays searchable as characters; structure rides in inline as Unicode-scalar offsets, never bytes.

object
inline
required
Array

One offset mark. Serialised flat with an adjacent kind tag, e.g. {"start":24,"len":6,"kind":"underline"}.

object
One of:
object
kind
required
string
Allowed values: bold
len
required

Length in Unicode scalar values. Zero for an image anchor, which marks an attachment point rather than a span.

integer format: int32
start
required

Offset in Unicode scalar values from the start of text.

integer format: int32
text
required
string
verified
required
boolean
total_pages
required
integer format: int32
total_records
required
integer

Example

{
"questions": [
{
"explanation": {
"body": {
"inline": [
{
"kind": "bold"
}
]
},
"key_point": {
"inline": [
{
"kind": "bold"
}
]
},
"trap": {
"inline": [
{
"kind": "bold"
}
]
}
},
"options": [
{
"text": {
"inline": [
{
"kind": "bold"
}
]
}
}
],
"text": {
"inline": [
{
"kind": "bold"
}
]
}
}
]
}

An API key is missing or invalid.

Media typeapplication/json

Stable body returned by HTTP error responses.

object
code
required
string
error
required
string

Example generated

{
"code": "example",
"error": "example"
}

The API key lacks the required scope.

Media typeapplication/json

Stable body returned by HTTP error responses.

object
code
required
string
error
required
string

Example generated

{
"code": "example",
"error": "example"
}

No such novel

Media typeapplication/json

Stable body returned by HTTP error responses.

object
code
required
string
error
required
string

Example generated

{
"code": "example",
"error": "example"
}

The caller has exceeded the applicable rate limit.

Media typeapplication/json

Stable body returned by HTTP error responses.

object
code
required
string
error
required
string

Example generated

{
"code": "example",
"error": "example"
}

The API is temporarily unavailable.

Media typeapplication/json

Stable body returned by HTTP error responses.

object
code
required
string
error
required
string

Example generated

{
"code": "example",
"error": "example"
}