# ファイルのダウンロード・情報取得

`GET /api/file/{hash}/{download}`

URL: https://repsona.com/ja/api/get-file-hash-download

download に attachment を指定するとファイルをダウンロードでき、property を指定するとファイルの情報を JSON で返します。url は指定できません。

## パラメーター

| name | in | type | required | description |
| --- | --- | --- | --- | --- |
| `hash` | path | string | 必須 | ファイルのハッシュ (UUID) です。アップロード時のレスポンスの hash に入っています。 |
| `download` | path | download \| property \| url | 必須 | `download` は添付ファイルとしてダウンロードし、`property` はファイルの情報を JSON で返します。`url` は対応しておらず 400 になります。 |

## リクエスト

```sh
curl -X GET "https://<space>.repsona.com/api/file/{hash}/{download}" \
  -H "Authorization: Bearer $REPSONA_API_KEY"
```

## レスポンス

- 200: File stream or metadata
- 206: Partial content (Range)
- 400: url mode is not supported
- 401: Authentication is required
- 403: Not a member of the file's project
- 404: File not found

## レスポンスの例

```json
{
  "file": {
    "id": 60,
    "hash": "a77661cf-f741-4981-af91-362572c5e0b4",
    "size": 68,
    "type": "image/png",
    "filename": "screenshot.png",
    "projectId": null,
    "createdAt": 1793662652069
  }
}
```
