IRPCObjectOperations.GetTextContentForFileWithFormat

View as Markdown

Vault API / core read session or assertion idempotent returns metadata structure version

Gets the text content of a file version as plain text or Markdown, and reports which format was produced.

ServiceObjects, versions, properties and files MFiles.IRPCObjectOperations
gRPC method/MFiles.IRPCObjectOperations/GetTextContentForFileWithFormat
HTTP (mf-http-grpc)POST /grpc/v1/get-text-content-for-file-with-format
RequestGetTextContentForFileWithFormatRequest
ResponseGetTextContentForFileWithFormatResponse
Book and levelVault API, core
Kindread
SessionRequired: a session (mfiles-session-id-bin metadata) or a session assertion (x-mf-session-assertion metadata).
Idempotentyes
Returns metadata structure versionyes (in the mfiles-metadata-version-bin trailer)
Streamingnone (unary)

Remarks

Supported when the server's ServerVaultCapabilities get_text_content_with_format_supported is true. Request FILE_FORMAT_MARKDOWN or FILE_FORMAT_PLAIN_TEXT; any other format returns plain text. Always read format_produced: it tells the format of text_content, which can be plain text even if Markdown was requested.

Request: GetTextContentForFileWithFormatRequest

The request of GetTextContentForFileWithFormat: the file version and the requested text format.

Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

FieldTypeDescription
obj_file_verObjFileVerThe object and the specific file version.
obj_file_ver.obj_idObjIDThe object that owns the file.
obj_file_ver.obj_id.typeint32The object type ID, for example 0 for documents. In a lookup value, the value list ID (for a lookup to objects, the object type ID).
obj_file_ver.obj_id.item_idItemIDThe ID of the object within its type, in item_id.internal_id.
obj_file_ver.file_verFileVerThe specific file version, as in File.file_ver.
obj_file_ver.file_ver.file_idFileIDThe file.
obj_file_ver.file_ver.typeFileVerTypeFILE_VER_TYPE_SPECIFIC for a file version number.Values: FILE_VER_TYPE_UNINITIALIZED (0), FILE_VER_TYPE_LATEST (1), FILE_VER_TYPE_ANY (2), FILE_VER_TYPE_SPECIFIC (3).
obj_file_ver.file_ver.internal_versionint32The file version number.
obj_file_ver.file_ver.external_repository_versionstringUsed only for files in external repositories. Leave empty.
obj_file_ver.file_ver.external_repository_sort_keyint64Used only for files in external repositories. Leave 0.
option_flagsTEXTCONTENTEXTRACTIONFLAGSExtraction flags. Leave unset for a fresh extraction.
option_flags.allboolSpecifies all flags set; Including any future flags.
option_flags.unpackcontainersboolUnpack container files.
option_flags.useplaintextcacheboolUse plain text cache. This makes other options, such as UNPACKCONTAINERS and max. content size ineffective. The operation returns the text content in same way it is returned for e.g. search indexing.
requested_formatFileFormatFILE_FORMAT_MARKDOWN or FILE_FORMAT_PLAIN_TEXT.Values: FILE_FORMAT_NATIVE (0), FILE_FORMAT_PDF (1), FILE_FORMAT_DISPLAY_ONLY_PDF (2), FILE_FORMAT_PLAIN_TEXT (3), FILE_FORMAT_MARKDOWN (4).

Response: GetTextContentForFileWithFormatResponse

The response of GetTextContentForFileWithFormat: the text and the format it was produced in.

Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

FieldTypeDescription
text_contentstringThe text, in the format given in format_produced.
format_producedFileFormatThe format of text_content.Values: FILE_FORMAT_NATIVE (0), FILE_FORMAT_PDF (1), FILE_FORMAT_DISPLAY_ONLY_PDF (2), FILE_FORMAT_PLAIN_TEXT (3), FILE_FORMAT_MARKDOWN (4).