# Get

## Retrieve an existing document

### Parameters:

| Name           | Optional / Required | Data type | Description                                                                                                                                                                                                                                                                                                                               | Default                                                                                                       |
| -------------- | ------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| id             | required            | Integer   | One of your document ids                                                                                                                                                                                                                                                                                                                  |                                                                                                               |
| return\_fields | optional            | String    | Customize the responses by setting the return fields (id, create\_date, update\_date, url, read\_url, short\_url, image\_small, image\_medium, image\_big, language, title, description, tags, embed\_code, settings)                                                                                                                     | id, url, short\_url, image\_small, image\_medium, image\_big, language, title, description, tags, embed\_code |
| image\_expiry  | optional            | Integer   | <p>Defines the expiration time in seconds for the image URL returned in the response. After this time, the URL will no longer be accessible. Use this parameter to control how long the image resource remains valid.<br>Accepted values: 60 (1 minute) to 31536000 (1 year). If not provided, the default is 7200 seconds (2 hours).</p> | 7200                                                                                                          |

### Demo

&#x20;URL Find your token on - [yumpu.com](https://www.yumpu.com/en/account/profile/api) Token&#x20;

&#x20;id&#x20;

#### Optional parameters:

&#x20;return\_fields&#x20;

Add optional parametersRun request

```
```

{% tabs %}
{% tab title="curl" %}
Example:

```
curl -X GET -H "X-ACCESS-TOKEN: YOUR_ACCESS_TOKEN" "https://api.yumpu.com/2.0/document.json?id=27109085"
```

{% endtab %}

{% tab title="PHP" %}
Example:

```php
require_once('../yumpu.php');
$yumpu = new Yumpu();
$data = array(
    'id' => 27109085,
    'return_fields' => 'id,create_date,update_date,url,image_small'
);
$listDocument = $yumpu->getDocument($data);
print_r($listDocument);
```

{% endtab %}

{% tab title="JavaScript" %}
Example:

```javascript
var yumpu = require('yumpu');
yumpu.setToken('yourToken');
var parameters = {
   id: 27109085
};
yumpu.getDocument(parameters, function(statusCode, document){
   console.log('Status: ' + statusCode);
   console.log(document);
});
```

{% endtab %}

{% tab title="Java" %}
Example:

```java
Yumpu y = new Yumpu("your access token");
String[] params = { "id=27109085" };
System.out.println(y.getDocument(params));
```

{% endtab %}
{% endtabs %}

Whatever language you are using, the result will be the same.

```javascript
{
  "document": [
    {
      "id": 55919352,
      "create_date": "2016-09-08 14:02:24",
      "update_date": "2016-09-08 14:03:03",
      "url": "https://www.yumpu.com/de/document/view/55919352/new-document",
      "image": {
        "small": "https://img.yumpu.com/55919352/1/115x163/new-document.jpg"
      }
    }
  ],
  "state": "success",
  "completed_in": 0.0562
}
```


---

# 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://developers.yumpu.com/api/document/documentget.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.
