**Version: 202201**

# Get File List

**GET** `/openapi/2022-01/file`

The Get File List API allows developers to retrieve a list of files stored on the server. This endpoint supports pagination and filtering based on the folder name.

## Request

**Query Parameters**

- `page` int32

  Page number; Defaults to 1 if not specified. Must be a positive integer.

  **Default value:** `1`
- `limit` int32

  The number of files to retrieve per page. Defaults to 20 if not specified. Must be greater than 0 and less than or equal to 300.

  **Default value:** `20`
- `folder` string

  The folder name to fetch files from. Defaults to "folder". Allowed values: -product - all_upload

  **Default value:** `product`

## Responses

**200 | 400 | 422**

200

**application/json**

**Schema | Example | Result**

**Schema**

- `files` object[]

  *   Array [

  - `upload_link` string

    **Example:** `https://cdn.shoplazza.com/7ebb4faa8d92e1d627edf9ca61a98993.png`
  - `file_uri` string

    **Example:** `7ebb4faa8d92e1d627edf9ca61a98993.png`
  - `folder` string

    **Example:** `upload`
  - `size` integer

    **Default value:** `0`

    **Example:** `6842`
  - `type` string

    **Example:** `image/png`
  - `origin_link` string

    **Example:**
  - `desc` string

    **Example:**
  - `aspect_ratio` string

    **Example:** `1.2500000`
  - `width` integer

    **Default value:** `0`

    **Example:** `250`
  - `height` integer

    **Default value:** `0`

    **Example:** `200`
  - `created_at` string

    **Example:** `2024-04-23T09:32:57+08:00`
  - `updated_at` string

    **Example:** `2024-04-23T09:32:57+08:00`
  *   ]

```json
{
  "files": [
    {
      "upload_link": "https://cdn.shoplazza.com/7ebb4faa8d92e1d627edf9ca61a98993.png",
      "file_uri": "7ebb4faa8d92e1d627edf9ca61a98993.png",
      "folder": "upload",
      "size": 6842,
      "type": "image/png",
      "origin_link": "",
      "desc": "",
      "aspect_ratio": "1.2500000",
      "width": 250,
      "height": 200,
      "created_at": "2024-04-23T09:32:57+08:00",
      "updated_at": "2024-04-23T09:32:57+08:00"
    }
  ]
}
```

```json
{
    "files": [
        {
            "upload_link": "https://cdn.shoplazza.com/7ebb4faa8d92e1d627edf9ca61a98993.png",
            "file_uri": "7ebb4faa8d92e1d627edf9ca61a98993.png",
            "folder": "upload",
            "size": 6842,
            "type": "image/png",
            "origin_link": "",
            "desc": "",
            "aspect_ratio": "1.2500000",
            "width": 250,
            "height": 200,
            "created_at": "2024-04-23T09:32:57+08:00",
            "updated_at": "2024-04-23T09:32:57+08:00"
        },
        {
            "upload_link": "https://cdn.shoplazza.com/652c51e6ea5273f8e0b5c3a30b62fd57.jpeg",
            "file_uri": "652c51e6ea5273f8e0b5c3a30b62fd57.jpeg",
            "folder": "url_upload",
            "size": 0,
            "type": "image/jpg",
            "origin_link": "",
            "desc": "",
            "aspect_ratio": "1.5032680",
            "width": 690,
            "height": 459,
            "created_at": "2024-04-23T09:25:54+08:00",
            "updated_at": "2024-04-23T09:25:54+08:00"
        }
    ]
}
```

400

**text/plain**

**Schema | Example | Result**

**Schema**

- `errors` string[]

```json
{
  "errors": [
    "Unauthorized"
  ]
}
```

```shell
{
  "errors": ["Unauthorized"]
}
```

422

**application/json**

**Schema | Example | Result**

**Schema**

- `errors` string[]

```json
{
  "errors": [
    "limit must be greater than 0"
  ]
}
```

```json
{
  "errors": ["limit must be greater than 0"]
}
```
