All Products
Search
Document Center

Intelligent Media Management:ExtractDocumentText

Last Updated:Aug 28, 2026

Extracts text from the body of a document file.

Operation description

  • Before you use this operation, make sure that you fully understand the billing and pricing of Intelligent Media Management (IMM).

  • Before you call this operation, make sure that a project is available in the current region. For more information, see Project Management.

  • Supported file formats include Word, Excel, PPT, PDF, and TXT.

  • The maximum file size is 200 MB. The extracted plain text must not exceed 2 MB (approximately 600,000 Chinese characters).

Important If the document format is complex or the text volume is too large, a timeout error may occur. In this case, we recommend that you use the CreateOfficeConversionTask operation and set the output format to TXT.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

imm:ExtractDocumentText

none

*Project

acs:imm:{#regionId}:{#accountId}:project/{#ProjectName}

None None

Request parameters

Parameter

Type

Required

Description

Example

ProjectName

string

Yes

The project name. For information about how to obtain the project name, see Creating a Project.

immtest

SourceURI

string

Yes

The storage address of the source data.

The OSS address follows the format oss://${Bucket}/${Object}, where ${Bucket} is the name of the OSS bucket in the same region as the current project, and ${Object} is the full path of the file including the extension.

Important Only HTTP protocol addresses are supported.

oss://test-bucket/test-object

SourceType

string

No

The file type of the source data. By default, the file type is determined by the file extension of the input object. If the input object has no extension, specify this parameter. Valid values:

  • Word Documents: doc, docx, wps, wpss, docm, dotm, dot, dotx, html

  • Presentation Documents (PPT): pptx, ppt, pot, potx, pps, ppsx, dps, dpt, pptm, potm, ppsm, dpss

  • Spreadsheet Documents (Excel): xls, xlt, et, ett, xlsx, xltx, csv, xlsb, xlsm, xltm, ets

  • PDF Documents: pdf

docx

CredentialConfig CredentialConfig

No

Leave this parameter empty if you have no special requirements.

Optional. Chain authorization configuration. For more information, see Using Chain Authorization to Access Other Entity Resources.

Response elements

Element

Type

Description

Example

object

The response body.

RequestId

string

The request ID.

94D6F994-E298-037E-8E8B-0090F27*****

DocumentText

string

The extracted text content of the document.

Test content.

Examples

Success response

JSON format

{
  "RequestId": "94D6F994-E298-037E-8E8B-0090F27*****",
  "DocumentText": "Test content."
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.