Skip to main content

GetFileContent

Retrieve the content of a file.

Try it now

You can run this API directly in OpenAPI Explorer without calculating signatures. After a successful call, OpenAPI Explorer can automatically generate SDK code examples. Try it now

RAM authorization

The following table describes the authorization information of the API. You can use the Action element in RAM permission policy statements to grant RAM users or RAM roles the permission to call this API. Details are as follows:
  • Action: the specific permission point.
  • Access level: the access level of each operation. Valid values: Write, Read, and List.
  • Resource type: the resource types that support authorization for the operation. Details are as follows:
    • Required resource types are marked with a preceding asterisk (*).
    • For operations that do not support resource-level authorization, All Resources is used.
  • Condition key: the condition keys defined by the cloud service itself.
  • Dependent action: other permissions required to successfully perform the operation. The caller must have the permissions of all dependent actions for the operation to succeed.
ActionAccess levelResource typeCondition keyDependent action
quanmiaolightapp:GetFileContentget
*All Resources
*
    None
None

Request syntax

POST /{workspaceId}/quanmiao/lightapp/getFileContent HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
fileKeystringNo

FileKey of the file (unique identifier of the file in the Miaobi service)

oss://default/aimiaobi-service-prod/aimiaobi/temp/1154600634854327_10045847/300469535473178749_300469535473178749_ee11508152b74137ac5747a6f632256e.docx
workspaceIdstringYes

Alibaba Cloud Model Studio workspace ID

llm-xxxx

Response elements

ElementTypeDescriptionExample
object

Schema of Response

requestIdstring

Id of the request

BE603C85-90AA-50FC-A2D6-128AA9FA200D
successstring

Whether the request is successful: true for success, false for failure.

true
dataobject

Result object

contentstring

Content

xxxx
httpStatusCodeinteger

HTTP status code

200
messagestring

Error description

successful
codestring

Response code

successful

Examples

Success response JSON format
{
  "requestId": "BE603C85-90AA-50FC-A2D6-128AA9FA200D",
  "success": true,
  "data": {
    "content": "xxxx"
  },
  "httpStatusCode": 200,
  "message": "successful",
  "code": "successful"
}

Error codes

HTTP status codeError codeError messageDescription
403NoPermissionYou are not authorized to perform this action , Please check the assignment of the workspaceId.Check the workspaceId assignment.
Visit the Error Center to view more error codes.