document_id.
Added in Python SDK 0.9.0 and JavaScript and TypeScript SDK 0.9.0. In TypeScript, pass one options object; every option is accepted in snake_case or camelCase (
customer_id or customerId). The result is returned as the server sends it, with snake_case fields, typed as Record<string, unknown>.section_key, or a range of pages. Use it to check what a cited section says, or to read around a passage that context.fetch returned. The call always reads the current version.
Parameters
Address the document one way: pass eitherdocument_key or document_id. Then pass exactly one of section_key or pages.
The document’s address, from a citation or a
knowledge.query result.A
section_key from documents.index.A page range,
"3-5" or (3, 5) ([3, 5] in TypeScript): whole page numbers from 1, with the end not before the start. A read returns at most 20 pages.The user you read the document as. Pass the same
user_id, customer_id and scope you use with context.fetch, also when you hold a document_key.The customer you read the document as. A customer’s document opens only for a call that names that customer. Not accepted on B2C.
Returns
Where the text came from:
document_key, document_id, version, section_key and section_path (for a section read), page and page_end, url and anchor when the source has a link, and added_at. source_disconnected is true when the document came from a connected source that has since been disconnected.document_key and version, and carries section_key or pages as you asked.
Example
Raises
InvalidInputError: when you pass both or neither ofsection_keyandpages,pagesis malformed, or the request is too large (more than 20 pages, or more text than one call returns; ask for a smaller section or range). Also when the page range holds no text, for example past the last page. Checkcode(serverCodein TypeScript),read_too_largeorinvalid_read_request, to tell them apart. None of these is charged.ContextNotFoundError: when the document or section does not exist or you cannot see it; these look the same on purpose. Withcode == "document_not_ready"(serverCodein TypeScript) the document is still being processed: try again shortly. Also when the feature is not enabled on your instance.FeatureNotInPlanError: when your plan does not include document navigation.CustomerIdNotAcceptedError: whencustomer_idis passed on a B2C instance.