public function getTemplateFiles($template_id, $dest_path = null, $type = 'pdf')
    {
        if ($dest_path) { // file stream
            $response = $this->rest->get(
                static::TEMPLATE_FILES_PATH . '/' . $template_id,
                $type ? array('file_type' => $type) : null
            );
            $this->checkResponse($response, false);
            file_put_contents($dest_path, $response);
        } else { // link
            $response = $this->rest->get(
                static::TEMPLATE_FILES_PATH . '/' . $template_id,
                array('get_url' => true)
            );
        }

        return $response;
    }
public function getTemplateFiles($template_id, $dest_path = null, $type = 'pdf')
    {
        if ($dest_path) { // file stream
            $response = $this->rest->get(
                static::TEMPLATE_FILES_PATH . '/' . $template_id,
                $type ? array('file_type' => $type) : null
            );
            $this->checkResponse($response, false);
            file_put_contents($dest_path, $response);
        } else { // link
            $response = $this->rest->get(
                static::TEMPLATE_FILES_PATH . '/' . $template_id,
                array('get_url' => true)
            );
        }

        return $response;
    }
public function getTemplateFiles ( $ template_id , $ dest_path = null , $ type = 'pdf' ) { if ( $ dest_path ) { // file stream $ response = $ this -> rest -> get ( static :: TEMPLATE_FILES_PATH . '/' . $ template_id , $ type ? array ( 'file_type' => $ type ) : null ) ; $ this -> checkResponse ( $ response , false ) ; file_put_contents ( $ dest_path , $ response ) ; } else { // link $ response = $ this -> rest -> get ( static :: TEMPLATE_FILES_PATH . '/' . $ template_id , array ( 'get_url' => true ) ) ; } return $ response ; }
Retrieves a link or copy of the files associated with a template

@param  string $template_id Template ID to retrieve files
@param  string $dest_path Where should the file be saved. Will retrieve link if empty. (optional)
@param  string $type Return the files as a single PDF or a zip of each document. Links will always be PDFs. (optional)
@return string
@throws BaseException
Retrieves a link or copy of the files associated with a template