# Download Document

## GET or POST Request

{% hint style="info" %}
<https://v1.api19.com/ra/documents/download>
{% endhint %}

Download a specific document ID in pdf format

| Argument     | Required | Type         |
| ------------ | -------- | ------------ |
| company\_id  | yes      | company id   |
| document\_id | yes      | document id  |
| key          | yes      | your api key |

{% tabs %}
{% tab title="Curl Post" %}

```php
curl https://v1.api19.com/ra/documents/download \
 -d 'company_id=h329fh23r' \
 -d 'document_id=h29gh2h23t32' \
 -d 'key=api_token'
```

{% endtab %}

{% tab title="Curl Get" %}

```
curl https://v1.api19.com/ra/documents/download?company_id=32yg23&document_id=h23gh23g2&key=apikey
```

{% endtab %}

{% tab title="JSON Response" %}

```json
NO DOCUMENT:
{
   "status": "error",
   "error": "No document found"
}

DOCUMENTS:
{
    "status": "ok",
    "file_type": "pdf",
    "data": "base64_encoded raw data"
}

```

{% endtab %}
{% endtabs %}
