# Download template

{% get /%}
{% path text="/v1/template/download" /%}

Returns the PDF document for the specified templateId. When the template is created on behalf of a particular sender email, then the download operation can be performed on the same account by specifying the email in the `onBehalfOf`. The form fields can be includeded in the document by enabling true in `includeFormFieldValues`.

## Code snippet

{% codetab %}

cURL

```shell
curl -X GET 'https://api.boldsign.com/v1/template/download?templateId=949ebf20-45a8-4a3e-91a9-68e9540e0020' \
-H 'accept: application/json' \
-H 'X-API-KEY: {your-api-key}'
```

C#

```csharp
var apiClient = new ApiClient("https://api.boldsign.com", "Your_API_Key");

var templateClient = new TemplateClient(apiClient);
var documentStream = templateClient.DownloadTemplate("YOUR_TEMPLATE_ID");

```

Python

```python
import boldsign

configuration = boldsign.Configuration(host = "https://api.boldsign.com", api_key="YOUR_API_KEY")

with boldsign.ApiClient(configuration) as api_client:

    template_api = boldsign.TemplateApi(api_client)
    template_api.download(template_id = "YOUR_TEMPLATE_ID")
```

PHP

```php
<?php require_once "vendor/autoload.php";

use BoldSign\Configuration;
use BoldSign\Api\TemplateApi;

$config = new Configuration();
$config->setHost('https://api.boldsign.com');
$config->setApiKey('YOUR_API_KEY');

$template_api = new TemplateApi($config); 
$template_api->download($template_id = 'YOUR_TEMPLATE_ID');
```

Java

```java
ApiClient client = Configuration.getDefaultApiClient();
client.setBasePath("https://api.boldsign.com");
client.setApiKey("YOUR_API_KEY");
            
TemplateApi templateApi = new TemplateApi(client);
templateApi.download("YOUR_TEMPLATE_ID", null);
```

NodeJS

```js
import { TemplateApi } from "boldsign";

const templateApi = new TemplateApi("https://api.boldsign.com");
templateApi.setApiKey("YOUR_API_KEY");

templateApi.download("YOUR_TEMPLATE_ID");
```

{% /codetab %}

## Query Parameters

{% nestedtable %}

- {% arguments name="templateId" /%}{% batch datatype="string" /%}{% required /%}
- The ID of the template to download.

---

- {% arguments name="onBehalfOf" /%}{% batch datatype="string" /%}
- The email address of the user that was used to create the template on their behalf.

---

- {% arguments name="includeFormFieldValues" /%}{% batch datatype="boolean" /%}
- This property specifies whether form field values should be included when downloading the template. If set to true, the downloaded template will contain the form field data; if set to false, the form fields will be excluded.

{% /nestedtable %}

## Example response

***200 Success***

```json
Contains the PDF document
```
