# Return autocomplete file and directory names

This function returns any files and directories that begin with a specified string.

Important:

  When you disable the File Storage role, the system disables this function.

Endpoint: GET /Fileman/autocompletedir
Version: 11.136.0.13
Security: BasicAuth

## Query parameters:

  - `path` (string, required)
    The prefix of the paths to complete.
    Example: "public"

  - `dirsonly` (integer)
    Whether to include only directories in the output.
* 1 — Only include directories.
* 0 — Include directories and files.
    Enum: 1, 0

  - `html` (integer)
    Whether to return HTML-encoded results.
* 1 — Return HTML-encoded output.
* 0 — Return plaintext output.
    Enum: 0, 1

  - `list_all` (integer)
    Whether to return all files and directories inside the specified
directory. If you set this parameter's value to 1, you must set the path
parameter's value to a full directory path.
* 1 — Return all files and directories inside the specified directory.
* 0 — Return partial file and directory name matches.
    Enum: 1, 0

## Response 200 fields (application/json):

  - `apiversion` (integer)
    The version of the API.
    Example: 3

  - `func` (string)
    The name of the method called.
    Example: "autocompletedir"

  - `module` (string)
    The name of the module called.
    Example: "Fileman"

  - `result` (object)

  - `result.data` (array)
    An array of objects containing the files and directories that match the specified path.

  - `result.data.file` (string)
    A file or directory that matches the specified path.
    Example: "public_ftp"

  - `result.errors` (array,null)
    List of errors if the API failed.

  - `result.messages` (array,null)
    List of messages generated by the API.

  - `result.metadata` (object)

  - `result.metadata.transformed` (integer)
    Post-processing may have transformed the data.
    Enum: 1

  - `result.status` (integer)
    - 1 — Success.
- 0 — Failed. Check the errors field for more details.
    Enum: 0, 1

  - `result.warnings` (array,null)
    List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.


