# File

## Get a list of files.

<mark style="color:blue;">`GET`</mark> `https://api.halosecurity.com/api/v1/file/list.json`

Returns a paginated list of files.

<https://app.halosecurity.com/user/security/report/files>

#### Query Parameters

<table><thead><tr><th width="178">Name</th><th width="116">Type</th><th>Description</th></tr></thead><tbody><tr><td>sort</td><td>Integer</td><td><code>0</code>= created date (default)</td></tr><tr><td>sort_desc</td><td>Integer</td><td><p><code>0</code> = No <em>(default)</em></p><p><code>1</code> = Yes</p></td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "list": [
        {
            "content_type": "application/pdf",
            "ready": 1,
            "file_name": "test.pdf",
            "file_id": "id1",
            "checksum_md5": "3cc6424d1d01d886f96770983e125fc5",
            "description": "",
            "folder": "",
            "date_created": "0000-00-00 00:00",
            "date_delete": "0000-00-00 00:00", 
            "file_size": 163637,
            "url": "https://www.halosecurity.com/static/dl?do=company-file&t=0&id=id1"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Get the details of a file.

<mark style="color:blue;">`GET`</mark> `https://api.halosecurity.com/api/v1/file/get.json`

Returns the details of a file.

<https://app.halosecurity.com/user/security/report/files>

#### Query Parameters

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| file\_id<mark style="color:red;">\*</mark> | String |             |
|                                            | String |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "file": {
        "content_type": "application/pdf",
        "ready": 1,
        "file_name": "test.pdf",
        "file_id": "id1",
        "checksum_md5": "3cc6424d1d01d886f96770983e125fc5",
        "description": "",
        "created_date": "0000-00-00 00:00",
        "file_size": 163637,
        "url": "/static/dl?do=company-file&t=0&id=id1"
    }
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    "code": 0,
    "message": "file_id required"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    "code": 0,
    "message": "file_id not valid"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
{
    "code": 0,
    "message": "file not found"
}
```

{% endtab %}
{% endtabs %}

## Delete a file

<mark style="color:blue;">`GET`</mark> `https://api.halosecurity.com/api/v1/file/delete.json`

Returns the file deletion status.

<https://app.halosecurity.com/user/security/report/files>

#### Query Parameters

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| file\_id<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "success": 1
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    "code": 0,
    "message": "file_id not valid"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
{
    "code": 0,
    "message": "file not found"
}
```

{% endtab %}
{% endtabs %}

### List Folders

<mark style="color:blue;">`GET`</mark> `https://api.halosecurity.com/api/v1/file/folder-list.json`

Returns a list of folders.

<https://app.halosecurity.com/user/security/report/folders>
