Skip to main content

CreateTextFile

This API uploads documents to the contract review module. After a successful upload, the system automatically parses the file. The API returns a file ID that you can use to generate review rules and results. File parsing uses a queuing mechanism. If the queue is long, parsing may be delayed.

Operation description

  • This API requires activation of the pay-as-you-go service for Farui products (activation is free of charge). You can use the AccessKey and AccessSecret of this account to call our OpenAPI service.
  • Calling this API requires workspace permissions on the Alibaba Cloud Model Studio platform.

Debugging

You can run this API directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After a successful run, OpenAPI Explorer can automatically generate SDK code examples. Debug

Authorization information

No authorization information is available for this API.

Request syntax

POST /{WorkspaceId}/data/textFile HTTP/1.1

Request parameters

NameTypeRequiredDescriptionExample
WorkspaceIdstringNo

Workspace ID of Alibaba Cloud Model Studio.

llm-9w5y60lseff0jiqm
ClientTokenstringNo

Client token used to ensure request idempotency. Generate a parameter value from your client and make sure it is unique across different requests. ClientToken only supports ASCII characters. If you do not specify it, the system automatically uses the RequestId of the API request as the ClientToken. The RequestId may vary for each API request.

e9a93201-7e96-4dc1-9678-2832fc132d08
CreateTimestringNo

Creation time.

1714476549
TextFileNamestringNo

Uploaded file name (with extension).

test-file.docx
TextFileUrlstringNo

Download URL of the uploaded file. To upload a file directly, use the CreateFileAdvanceRequest of the SDK.

https://xx.test-file.docx
ContractIdstringNo

Used in contract comparison scenarios. The first file upload returns a ContractId. If comparison is required, pass this parameter in the second upload and upload the standard document.

123

Response parameters

NameTypeDescriptionExample
object

Schema of Response

Codestring

Error code.

null
Dataobject

File information returned when the call succeeds.

TextFileIdstring

ID of the created file.

36d6447d277c4a1c9fd0def1d16341f1
TextFileNamestring

File name.

test-file.docx
TextFileUrlstring

File URL.

https://xx.test-file.docx
ContractIdstring

Contract record. Pay attention to this value in comparison mode.

11123
HttpStatusCodelong

HTTP status code.

200
Messagestring

If the request is abnormal, the specific error message returned.

null
RequestIdstring

Id of the request

81E6F6D2-8ACB-5BDA-9C7C-4D6268CD9652
Successboolean

Indicates whether the call is successful. true: The call is successful. false: The call failed.

True

Examples

Success response JSON format
{
  "Code": null,
  "Data": {
    "TextFileId": "36d6447d277c4a1c9fd0def1d16341f1",
    "TextFileName": "测试文件.docx",
    "TextFileUrl": "https://xx.测试文件.docx",
    "ContractId": 11123
  },
  "HttpStatusCode": 200,
  "Message": null,
  "RequestId": "81E6F6D2-8ACB-5BDA-9C7C-4D6268CD9652",
  "Success": true
}

Error codes

Visit the Error Center to view more error codes.

Change history

Change timeChange summaryOperation
2025-11-13OpenAPI input parameters changed, and the OpenAPI response structure changed.View change details