Get Template Files

get/template/files/{template_id}

Obtain a copy of the current documents specified by the template_id parameter.

Returns a PDF or ZIP file, or if get_url is set, a JSON object with a url to the file (PDFs only). If get_data_uri is set, a JSON object with a data_uri representing the base64 encoded file (PDFs only) is returned.

If the files are currently being prepared, a status code of 409 will be returned instead. In this case please wait for the template_created callback event.

Securityapi_key or oauth2
Request
path Parameters
template_id
required
string

The id of the template files to retrieve.

Example: f57db65d3f933b5316d398057a36176831451a35
query Parameters
file_type
string

Set to pdf for a single merged document or zip for a collection of individual documents.

Enum: "pdf" "zip"
get_url
boolean
Default: false

If true, the response will contain a url link to the file instead. Links are only available for PDFs and have a TTL of 3 days.

get_data_uri
boolean
Default: false

If true, the response will contain the file as base64 encoded string. Base64 encoding is only available for PDFs.

Responses
200

successful operation

4XX

failed_operation

Request samples
<?php

require_once __DIR__ . "/vendor/autoload.php";

$config = HelloSignSDK\Configuration::getDefaultConfiguration();

// Configure HTTP basic authorization: api_key
$config->setUsername("YOUR_API_KEY");

// or, configure Bearer (JWT) authorization: oauth2
// $config->setAccessToken("YOUR_ACCESS_TOKEN");

$api = new HelloSignSDK\Api\TemplateApi($config);

$templateId = "5de8179668f2033afac48da1868d0093bf133266";

try {
    $result = $api->templateFiles($templateId);
    print_r($result);
} catch (HelloSignSDK\ApiException $e) {
    $error = $e->getResponseObject();
    echo "Exception when calling HelloSign API: "
        . print_r($error->getError());
}