> For the complete documentation index, see [llms.txt](https://wpcloudplugins.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wpcloudplugins.gitbook.io/docs/developers/api/get_folder.md). Agents can also search and read this documentation through its [MCP server](https://wpcloudplugins.gitbook.io/docs/~gitbook/mcp).

# get\_folder()

## Get folder metadata and children

&#x20; <mark style="background-color:orange;">get\_folder()</mark> &#x20;

This method will get a specific folder on Google and the files/folders directly inside it.

{% tabs %}
{% tab title="OneDrive" %}

### **Parameters**

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| `$id` | string | Folder ID   |

### **Return**

| Name    | Type           | Description                                 |
| ------- | -------------- | ------------------------------------------- |
| `$node` | **CachedNode** | The cached object for the requested folder. |

### **Usage**

```php
WPCP_ONEDRIVE_API::set_account_by_id('8c9bacda0-d8d8-4b22-b634-7b5281687575');
WPCP_ONEDRIVE_API::set_drive_by_id('b!DlaHWskCed_MIid3KpJH5Lbatf9HsdXBAZH5YcvPAbMhJUKzTJyzgvXZYpBS');

$node = WPCP_ONEDRIVE_API::get_folder('01EXLSWHRCD7RDL3HX65BK5X3ULXLWSICN');

$node->get_name();

foreach ($node->get_children() as $id => $entry_node) {
  $entry_node->get_name();
}
```

{% endtab %}

{% tab title="Google Drive" %}

### **Parameters**

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| `$id` | string | Folder ID   |

### **Return**

| Name    | Type           | Description                                 |
| ------- | -------------- | ------------------------------------------- |
| `$node` | **CachedNode** | The cached object for the requested folder. |

### **Usage**

```php
WPCP_GDRIVE_API::set_account_by_id('201096615285735764133')

$node = WPCP_GDRIVE_API::get_folder('1FCYkOJb150I8nl8DE92YIXWaB0J7VOk5');

$node->get_name();

foreach ($node->get_children() as $id => $entry_node) {
  $entry_node->get_name();
}
```

{% endtab %}

{% tab title="Dropbox" %}

### **Parameters**

| Name        | Type   | Description                                                                                                               |
| ----------- | ------ | ------------------------------------------------------------------------------------------------------------------------- |
| `$id`       | string | Folder ID or absolute path for file or folder. A path should start with '/'                                               |
| (`$params)` | array  | Additional Parameters. Use `['recursive' => true, 'hierarchical' => true]` to load the content in the folder recursively. |

### **Return**

| Name     | Type      | Description                          |
| -------- | --------- | ------------------------------------ |
| `$entry` | **Entry** | The object for the requested folder. |

### **Usage**

```php
WPCP_DROPBOX_API::set_account_by_id('dbid:AADSy6JxzbgqCs4A43CAAAfO9xvZwpcsLU');

$folder = WPCP_DROPBOX_API::get_folder('/path/to/folder');

$folder->get_name();

foreach ($folder->get_children() as $id => $entry) {
  $entry->get_name();
}
```

{% endtab %}

{% tab title="Box" %}

### **Parameters**

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| `$id` | string | Folder ID   |

### **Return**

| Name    | Type           | Description                                 |
| ------- | -------------- | ------------------------------------------- |
| `$node` | **CachedNode** | The cached object for the requested folder. |

### **Usage**

```php
WPCP_BOX_API::set_account_by_id('29232154182');

$node = WPCP_BOX_API::get_folder('511426724354');

$node->get_name();

foreach ($node->get_children() as $id => $entry_node) {
  $entry_node->get_name();
}
```

{% endtab %}
{% endtabs %}
