One section of a document, with its text
const url = 'http://localhost:11044/api/v1/documents/sections?uri=example&ordinal=1&chunks=false';const options = {method: 'GET', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>'}};
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:11044/api/v1/documents/sections?uri=example&ordinal=1&chunks=false' \ --header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>'The section at ordinal in reading order, as GET /documents/outline numbers them. text is the markdown directly under that heading, or null for one that only holds other sections.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”The document’s uri, as GET /documents lists it
The section’s place in reading order, counted from 0
True to include the chunks the section was cut into, which is what search matches against
Responses
Section titled “Responses”The section
What GET /documents/sections answers: one heading of a stored document, with the words directly under it
object
The chunks search matches against for this section, in order. Null unless chunks=true was asked, or when the section has no words of its own
One chunk of a section’s words, as it was cut from the document at ingest
object
The chunk’s id in the document store
The chunk’s text as cut, without the provenance lines added to it for embedding
True when the section is too short to have chunks of its own, so chunks are the ones it shares with its neighbours. Null whenever chunks is
The heading at the requested ordinal
object
1 for a heading directly inside the document, 2 for one inside that, and so on. Null when not recorded
Whether it has words of its own to read. A heading can have both words and headings inside it
The section’s id: what sectionId on a POST /documents/ask source refers to
Whether it has no headings inside it
Its place in reading order, counted from 0: the ordinal GET /documents/sections takes. Not every number is used. Null when the stored section carries none
Id of what this heading sits directly inside: the enclosing heading, or the document itself for a top-level heading. Null when not recorded
The heading’s text
The markdown directly under this heading, as converted at ingest. Null for a heading that only holds other sections
The document’s uri, as the request named it
No such document in the caller’s world, or no section at that ordinal
A 404 from the document reader: the caller’s world holds no such document, or the document has no such section
object
What was not found, naming the uri and, for a section, the ordinal

