# Download a file of a group

`GET /api/v1/vaults/{vault}/groups/{group}/files/{file}/content` and `QUERY /api/v1/vaults/{vault}/groups/{group}/files/{file}/content`

Return the file itself, byte for byte.

Files kept with a group need both groups and file upload to be available to your account. Until they are, every endpoint here answers 404.

This endpoint does not answer in JSON. The body is the file, sent with the type and the name it was uploaded with, so what you receive can be written straight to disk. Images are marked to display in place and every other type is marked as a download.

This endpoint answers GET and QUERY alike, and both return the same answer. GET sends the parameters in the address, QUERY in the request body. [How QUERY works](https://people.hansyeoh.com/docs/api/query-method).

## Path parameters

- `vault` (string, required): The vault the group lives in, named either by the readable name it reports as slug or by its id.
- `group` (uuid, required): The id of the group. One addressed through the wrong vault, deleted, or belonging to another account, answers 404.
- `file` (uuid, required): The id of the file as kept with the group, which is the id of the group file object and not the id of the stored file. One kept with another group answers 404.

## Returns

The file. A file of another account, one kept with another group, or one whose content is no longer stored answers 404.

## Rate limit

Sixty requests per minute, per user, shared by every key and device. Every answer carries the budget left in `X-RateLimit-Remaining`.

## Request

```sh
curl https://people.hansyeoh.com/api/v1/vaults/dunder-mifflin/groups/5d2a7c91-3e48-4b06-9f1d-a83c60e2b4f7/files/c4a8e1d7-6b32-4f95-8d10-2e7a93b5f6c8/content \
  -H "Authorization: Bearer $MONICA_TOKEN"
```

```javascript
const response = await fetch('https://people.hansyeoh.com/api/v1/vaults/dunder-mifflin/groups/5d2a7c91-3e48-4b06-9f1d-a83c60e2b4f7/files/c4a8e1d7-6b32-4f95-8d10-2e7a93b5f6c8/content', {
  headers: { Authorization: `Bearer ${token}` },
})
const data = await response.json()
```

```php
$response = Http::withToken($token)->get('https://people.hansyeoh.com/api/v1/vaults/dunder-mifflin/groups/5d2a7c91-3e48-4b06-9f1d-a83c60e2b4f7/files/c4a8e1d7-6b32-4f95-8d10-2e7a93b5f6c8/content');
```

## Request with QUERY

```sh
curl https://people.hansyeoh.com/api/v1/vaults/dunder-mifflin/groups/5d2a7c91-3e48-4b06-9f1d-a83c60e2b4f7/files/c4a8e1d7-6b32-4f95-8d10-2e7a93b5f6c8/content \
  -X QUERY \
  -H "Authorization: Bearer $MONICA_TOKEN"
```

```javascript
const response = await fetch('https://people.hansyeoh.com/api/v1/vaults/dunder-mifflin/groups/5d2a7c91-3e48-4b06-9f1d-a83c60e2b4f7/files/c4a8e1d7-6b32-4f95-8d10-2e7a93b5f6c8/content', {
  method: 'QUERY',
  headers: { Authorization: `Bearer ${token}` },
})
const data = await response.json()
```

```php
$response = Http::withToken($token)->query('https://people.hansyeoh.com/api/v1/vaults/dunder-mifflin/groups/5d2a7c91-3e48-4b06-9f1d-a83c60e2b4f7/files/c4a8e1d7-6b32-4f95-8d10-2e7a93b5f6c8/content');
```

## Response

`200`, with no body.
