﻿---
sidebar_position: 4
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Get list of files
 Gets a list of files with or without directory selection



`Function GetFilesList(Val Token, Val Path = "") Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Token | --token | String | &#x2714; | Auth token |
  | Path | --path | String | &#x2716; | Selection of files by catalog. All if not filled in |

  
  Returns:  Map Of KeyAndValue - serialized JSON response from Neocities

<br/>

:::tip
Neocities API docs: [neocities.org/api](https://neocities.org/api)
:::
<br/>



```bsl title="1C:Enterprise/OneScript code example"
    Token = "7419cd51de4037f7...";
    Path  = "test";

    Result = OPI_Neocities.GetFilesList(Token, Path);

    Result = OPI_Neocities.GetFilesList(Token);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint neocities GetFilesList \
             --token "***" \
             --path "test"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint neocities GetFilesList ^
             --token "***" ^
             --path "test"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "result": "success",
 "files": [
  {
   "path": "test/gif.gif",
   "is_directory": false,
   "size": 805189,
   "created_at": "Wed, 09 Oct 2024 06:27:52 -0000",
   "updated_at": "Wed, 09 Oct 2024 06:27:52 -0000",
   "sha1_hash": null
  },
  {
   "path": "test/pic1.png",
   "is_directory": false,
   "size": 2114023,
   "created_at": "Wed, 09 Oct 2024 06:27:52 -0000",
   "updated_at": "Wed, 09 Oct 2024 06:27:52 -0000",
   "sha1_hash": null
  }
 ]
}
```
