跳转到内容

上传文件至网址

Request

登记一个已上传的文件,让云手机去下载它。

  • 前置条件:云手机必须已开机且未被其他成员占用,且该对象必须已经存在于给定 URL——服务会去探测它,读不到就拒绝请求。直播素材必须是 MP4,且目标机型需支持直播。
  • 完成信号:已受理,未完成。 响应返回 fileId 和一个进行中状态;请轮询 /api/cloudphone/upload/file/result。
  • 接口面说明:与 Open API 的 /cloudphone/uploadFile 是同一套实现。不要与本接口面上那条较旧的 /api/cloudphone/uploadFile 分片上传链路混淆。

已记录的业务错误码:33401, 33419。 各错误码的含义见 Error Codes。任何接口还可能返回通用错误码。

Bodyapplication/jsonrequired
idstringrequired

Cloud phone ID

urlstringrequired

Upload url, which can be the link returned by the cloudphone/upload/file/signedURL interface or other publicly accessible file download address

uploadDeststringrequired

Storage directory

uploadTypeinteger

File type (1 = regular file, 2 = MP4 live-streaming file)

Default:1
Enum:12
curl -i -X POST \
  http://127.0.0.1:40000/api/cloudphone/upload/file \
  -H 'Content-Type: application/json' \
  -d '{
    "url": "https://example-bucket.s3.amazonaws.com/prod/cloudPhoneOpenApi/1666625111121936/20260901/demo.mp4",
    "id": "1666625111121936",
    "uploadDest": "/Download",
    "uploadType": 2
  }'

Responses

Success. data is an object with the fields id, fileId and status.

Headers
any
Bodyapplication/json
codeintegerrequired

Response code, 0 indicates success,>0 indicates failure

msgstring or nullrequired
dataobjectrequired
requestIdstringrequired
Response
{ "code": 0, "msg": null, "data": { "id": "1666625111121936", "fileId": "10069435", "status": 0 }, "requestId": "e5d69c5e2d364106a0715dab1d9a03d3" }