# 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
}
```
