Workspaces

Read a file

The text of one ingested file: all of it, one tab or section (component), some pages (pages), or a span of lines of that text (line_start, line_end), up to max_chars characters. A file with several tabs or sections answers with each under a header line naming it; components_omitted lists any left out. sql_tables names the tables holding the rows of the long tables printed, to count or total with run-sql. File reads and SQL queries together are limited to 600 per account every 10 minutes. Free.

post/v1/workspaces/{id}/tools/read-file

Request

Path parameters

idstring required

The workspace's workspace_id.

Headers

Idempotency-Keystring

Up to 200 characters, unique per account. A call that timed out keeps running: send it again with the same key and body to get its answer instead of running it twice.

Request body

pathstring required

The file's path in the workspace, as it was uploaded.

pagesinteger[] nullable

Pages to read, 1-based; leave it out for every page. Spreadsheets have no pages: name a tab with component.

componentstring nullable

One tab or section to read; leave it out for the whole file.

max_charsinteger

The most characters to return; past it, truncated is true.

line_startinteger nullable

The first line to return, 1-based, counted in the text this read returns without a line span. Leave it out for line 1.

line_endinteger nullable

The last line to return, inclusive. Leave it out for the last line.

Response

The answer.

pathstring required
file_idstring required
contentstring required

The text read. Each tab or section of a file with several starts with a header line naming it.

pages_returnedinteger[] required

The pages in content, in order; a page past the end is left out.

truncatedboolean required

True when max_chars cut the text.

components_returnedstring[] required

The tabs or sections in content.

components_omittedstring[] required

The tabs or sections left out: cut for size, or with no text to read.

sql_tablesstring[]

The run-sql names of the tables holding the rows of the long tables in content: count, total or rank those rows there.

line_startinteger nullable

The first line returned, when the request named a span.

line_endinteger nullable

The last line returned, when the request named a span; null when line_start is past the end.

line_countinteger nullable

How many lines the whole text has, when the request named a span.

job_idstring nullable

The job the call ran as; GET /v1/documents/jobs/{id} reads it.

Changes

No recorded changes to this operation across all 1 revision of this API.