Extract text from the document
Operation description
-
Before using this interface, please make sure you fully understand the billing method and pricing of the Intelligent Media Management product.
-
Before calling this interface, ensure that there is an available project ( Project ) in the current Region. For more details, see Project Management.
-
Supports common Word, Excel, PPT, PDF, and TXT documents.
-
The file size must not exceed 200 MB. The extracted plain text file size should not exceed 2 MB (approximately 600,000 Chinese characters).
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| imm:ExtractDocumentText | none | *Project acs:imm:{#regionId}:{#accountId}:project/{#ProjectName} |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| ProjectName | string | Yes | Project name. For how to obtain it, see Creating a Project. | immtest |
| SourceURI | string | Yes | Storage address of the source data. The OSS address rule is oss://${Bucket}/${Object}, where Notice Currently, only HTTP protocol addresses are supported. | oss://test-bucket/test-object |
| SourceType | string | No | Suffix type of the source data. By default, the type of the source data is determined based on the suffix of the input object. When the input object does not have a suffix, you can set this parameter. The available values are as follows:
| docx |
| CredentialConfig | CredentialConfig | No | If there are no special requirements, leave it blank. Chain authorization configuration, optional. For more information, see Using Chain Authorization to Access Other Entity Resources. |
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "94D6F994-E298-037E-8E8B-0090F27*****",
"DocumentText": "测试内容。"
}Error codes
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2023-12-13 | The request parameters of the API has changed | View Change Details |
