# ファイルダウンロード

クラウドフォンからファイルをダウンロードします。
- **前提条件**：クラウドフォンが起動済みで、他のメンバーに占有されていないこと。
- **副作用**：サービスは先に親ディレクトリを走査してから転送を開始するため、存在しないパスは状態のポーリングではなく**この時点**で失敗します。対象は通常ファイルである必要があり、ディレクトリは不可です。
- **完了シグナル**：**受理されただけで、完了ではありません。** レスポンスは `downId` を返します。`/cloudphone/download/result` を、状態が成功・失敗・キャンセルのいずれかになるまでポーリングしてください。その状態エンドポイントは、クラウドフォンが今も起動済みで自分の占有下にあることを再確認します。
- **リトライ**：冪等ではありません — 呼び出しごとに再走査し、新しい `downId` を発行します。

文書化されたビジネスエラー: `33300`, `33301`, `33507`。 各コードの意味は [Error Codes](../Getting%20Started/error-codes.md) を参照してください。どの操作でも共通コードが返る場合があります。

Endpoint: POST /cloudphone/download
Version: 2026-09-05
Security: Authorization

## Security:

  - `Authorization` (unknown)
    http bearer JWT

## Request fields (application/json):

  - `id` (string, required)
    cloud phone id

  - `filePath` (string, required)
    file path: /sdcard/Download/a.txt

## Response 200:

  - `200` (unknown)
    Success. `data` is an object with the fields `id` and `downId`.

## Response 200 fields (application/json):

  - `code` (integer, required)
    Response code, 0 indicates success,>0 indicates failure

  - `msg` (string | null, required)

  - `data` (object, required)

  - `data.id` (string, required)
    Cloud phone id

  - `data.downId` (string, required)
    File download id

  - `requestId` (string, required)

