# Box

> Upload, share, and manage files stored in Box.

App · File Storage · 4 actions · 1 trigger. Web page: https://docs.lodol.com/docs/integrations/box

## Triggers

Start a workflow when something happens in Box. See [how triggers work](https://docs.lodol.com/docs/concepts/triggers.md).

### Box New File

Triggers when a new file is added to Box

**Filters**: Narrow which events start a run.

- `folder_id`

**Event fields**: What a run starts with. Later steps read each field with an @ reference.

- `id` (text)
- `name` (text)
- `type` (text)

## Actions

### Create shared link

Create a shared link for a Box file. You can control whether the link allows downloads and previews.

**Inputs**

- File ID (`file_id`, text, required): The ID of the Box file to share.
- Access (`access`, text): Who can open the link. One of: `open` (Anyone with the link), `company` (People in your company), `collaborators` (Only invited collaborators).
- Allow download (`allow_download`, true/false): Set to true to let people who can open the link to download the file. Default: `true`.
- Allow preview (`allow_preview`, true/false): Set to true to let people who can open the link to preview the file. Default: `true`.

**Outputs**

- `shared_link` (text)

**Example output**

```json
{
  "shared_link": "https://box.com/s/abc123xyz789def456"
}
```

### Download file

Download a file from Box.

**Inputs**

- File ID (`file_id`, text, required): The ID of the Box file to download.

**Outputs**

- `document_ref` (text): Reference to the downloaded file, usable as a file input in later steps
- `file_name` (text)

**Example output**

```json
{
  "document_ref": "doc_0123456789abcdef0123456789abcdef",
  "file_name": "report.pdf"
}
```

### List folder items

List the files and subfolders inside a Box folder.

**Inputs**

- Folder ID (`folder_id`, text, required): The ID of the Box folder to look in.

**Outputs**

- `items` (list)

**Example output**

```json
{
  "items": [
    {
      "id": "987654321",
      "name": "report.pdf",
      "type": "file"
    }
  ]
}
```

### Upload file

Upload a file to a Box folder and get a shareable link.

**Inputs**

- Folder ID (`folder_id`, text, required): The ID of the Box folder to upload into.
- File to upload (`file_path`, text, required): The file to upload: upload one, pick a file from an earlier step, or paste a link to one.
- File name (`file_name`, text): A different name to save the file as in Box. If left blank, the original file name is used.

**Outputs**

- `file_id` (text)
- `file_link` (text)

**Example output**

```json
{
  "file_id": "123456789",
  "file_link": "https://app.box.com/file/123456789"
}
```
