## A file of the ticket: viewable types inline, everything else and download=true as attachment (desk:read)

`GET /api/desk/v1/items/{ref}/attachments/{documentId}/content`

Module: Desk · operationId: `getItemAttachmentContent` · Tag: Mail · Auth: access token (`Authorization: Bearer <accessToken>`)

Viewable types (png, jpeg, gif, webp, PDF, text types incl. JSON, and message/rfc822 as `text/plain; charset=utf-8`) answer `Content-Disposition: inline`; HTML, SVG, XML, office files, archives and unknown types are a download. `download=true` always downloads with the real file name. The decision is made by `common/pkg/filecontent`, the same for the customer routes.

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `download` | query | boolean |  | true (or 1) answers as a download (`Content-Disposition: attachment` with the file name) instead of the inline view of viewable types (default `false`) |
| `ref` | path | string | yes | Item id or number |
| `documentId` | path | string | yes |  |

### Responses

- **200** The file (`application/octet-stream`)
- **403** The malware scan found something (code infected)
- **404** No such file on the ticket
- **409** The malware scan has not cleared the file (yet): pending, or failed and scanned again later (code scan_pending; DMS answers the same as not_scanned)
- **503** The file store is not configured (code unavailable)

### Example request

```bash
curl -X GET 'https://api.mbcom.cloud/api/desk/v1/items/string/attachments/string/content' \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```
