# get\_entry()

## Get MetaData for file/folder

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

This method will set the account to be used for other API calls.

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

### **Parameters**

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

### **Return**

| Name    | Type           | Description                                         |
| ------- | -------------- | --------------------------------------------------- |
| `$node` | **CachedNode** | The cached object for the requested file or 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_entry('01EXLSWHWMQZNDMLRG7NFIWAVYCFJAXP2R');

$node->get_name();
```

{% endtab %}

{% tab title="Google Drive" %}

### **Parameters**

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

### **Return**

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

### **Usage**

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

$node = WPCP_GDRIVE_API::get_entry('1wzWlDMsZkA4N5yEEAmMigp52u7M0Lk_7');

$node->get_name();
```

{% endtab %}

{% tab title="Dropbox" %}

### **Parameters**

| Name  | Type   | Description                                                                        |
| ----- | ------ | ---------------------------------------------------------------------------------- |
| `$id` | string | File / Folder ID or absolute path for file or folder. A path should start with '/' |

### **Return**

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

### **Usage**

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

$entry = WPCP_DROPBOX_API::get_entry('/path/to/file.jpg');

$entry->get_name();
```

{% endtab %}

{% tab title="Box" %}

### **Parameters**

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

### **Return**

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

### **Usage**

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

$node = WPCP_BOX_API::get_entry('511426721354');

$node->get_name();
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wpcloudplugins.gitbook.io/docs/developers/api/get_entry.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
