Files
Get file text
Read a file’s extracted plain text, one page at a time.
GET
Returns one page of a file’s plain text. Wordsmith extracts the text from documents, spreadsheets, presentations, images and other supported types. Tracked changes in a Word document are kept.
Read a long file page by page:
- Call without
offset. The first page starts at character 0. - While
next_offsetis notnull, call again withoffsetset tonext_offset. - When
next_offsetisnull, you have the last page.
total_chars is the length of the whole text, so you can tell how many pages are left. An offset at or past the end returns empty text and a null next_offset.
A file is served only once its malware scan is clean. While the scan is still running, the response is 409 scan_in_progress; retry shortly. A file the scanner could not scan, such as a password-protected archive, returns 422 file_not_scannable, which a retry will not change. A file the scan flagged returns 404, as a missing file does.
Authentication
Send an API key, or an OAuth access token with thefiles:read scope, as a bearer token in the Authorization header. files:write does not include files:read. A token without the scope gets 403 with "error": "insufficient_scope".
Path parameters
Query parameters
The most characters to return. 1 or greater. Values over 100,000 are treated as 100,000.