跳转到内容

文件下载

Request

从云手机下载文件。

  • 前置条件:云手机必须已开机且未被其他成员占用。
  • 副作用:服务端先扫描父目录再启动传输,因此路径不存在会在这一步失败,而不是在状态轮询时。目标必须是普通文件,不能是目录。
  • 完成信号已受理,未完成。 响应返回 downId;轮询 /cloudphone/download/result 直到状态为成功、失败或已取消。该状态接口会重新校验云手机仍已开机且仍归你占用。
  • 重试:不幂等——每次调用都会重新扫描并生成新的 downId

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

Security
Authorization
Bodyapplication/jsonrequired
idstringrequired

cloud phone id

filePathstringrequired

file path: /sdcard/Download/a.txt

curl -i -X POST \
  https://api.morelogin.com/cloudphone/download \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "filePath": "/sdcard/Download/report.csv",
    "id": "1661515884160372"
  }'

Responses

Success. data is an object with the fields id and downId.

Headers
any
Bodyapplication/json
codeintegerrequired

Response code, 0 indicates success,>0 indicates failure

msgstring or nullrequired
dataobjectrequired
requestIdstringrequired
Response
{ "code": 0, "msg": "", "data": { "id": "1661515884160372", "downId": "1661515884160999" }, "requestId": "7dcf166a597842139af5ce12d25fe0f8" }