Skip to main content
其他

ApplyFileUploadLease - 申请文件上传租约

申请文件上传租约,获取预签名上传 URL

POST
/v2/api/bailian/2023-12-29/{WorkspaceId}/datacenter/category/{CategoryId}
cURL
curl --request POST \
  --url 'https://bailian.{regionId}.aliyuncs.com/v2/api/bailian/2023-12-29/{WorkspaceId}/datacenter/category/{CategoryId}' \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "FileName": "产品清单.pdf",
  "Md5": "19657c391f6c70bcea63c154d8606bb3",
  "SizeInBytes": "1000"
}
'
{
  "Code": "",
  "Data": {
    "FileUploadLeaseId": "1e6a159107384782be5e45ac4759b247.1719325231035",
    "Param": {
      "Headers": "\"X-bailian-extra\":\"MTAwNTQyNjQ5NTE2OTE3OA==\",\n\"Content-Type\":\"application/pdf\"",
      "Method": "PUT",
      "Url": "https://bailian-datahub-data-origin-prod.oss-cn-hangzhou.aliyuncs.com/xxx.pdf?Expires=1716699536"
    },
    "Type": "HTTP"
  },
  "Message": "",
  "RequestId": "778C0B3B-xxxx-5FC1-A947-36EDD13606AB",
  "Status": "200",
  "Success": true
}

Authorizations

string
header
required

阿里云 AccessKey 签名认证

Path Parameters

string
required

工作空间 ID

string
required

文件所属类目 ID

Body

application/json
string
required

文件名称,需包含扩展名

string
required

文件 MD5 值

string
required

文件大小(字节),取值范围 1B-100MB

enum<string>

类目类型,默认 UNSTRUCTURED

UNSTRUCTURED,SESSION_FILE
boolean

是否使用内网 URL(默认 false)

Response

200-application/json
string

错误码

object

业务数据

string
string
string
boolean
Managed Agent API
RAG API
Connector API
Memory API
框架集成
  • 框架