pdf_generator_client.PdfTemplateApi

All URIs are relative to /api

MethodHTTP requestDescription
createPOST /pdf-templateCreate a template
create_filesPOST /pdf-template/{id}/filesUpload template files
create_from_zipPOST /pdf-template/from-zipCreate template from ZIP
delete_fileDELETE /pdf-template/{id}/files/{file}Delete a file
destroyDELETE /pdf-template/{lookup}Delete a template
export_as_zipGET /pdf-template/{id}/files/export-zipExport template files as ZIP archive
get_context_schemaGET /pdf-template/{id}/context-schemaGet JSON schema for template variables
get_default_valuesGET /pdf-template/{id}/variables-default-valuesGet template variable default values
get_file_contentGET /pdf-template/{id}/files/content/{file}Download file content
get_file_typeGET /pdf-template/{id}/files/type/{file}Get file type
import_zipPOST /pdf-template/{id}/files/import-zipUpload files from ZIP
listGET /pdf-templateList templates
list_filesGET /pdf-template/{id}/filesList template files
renderPOST /pdf-template/renderRender a PDF
replacePUT /pdf-template/{lookup}Replace a template
retrieveGET /pdf-template/{lookup}Get a template
updatePATCH /pdf-template/{lookup}Update a template

create

PdfTemplate create(create_pdf_template_dto, limit=limit, offset=offset, order=order, filter=filter, var_or=var_or, expand=expand)

Create a template

Create a new PDF template (Admin only)

Example

  • Api Key Authentication (api-key):
import pdf_generator_client
from pdf_generator_client.models.create_pdf_template_dto import CreatePdfTemplateDto
from pdf_generator_client.models.pdf_template import PdfTemplate
from pdf_generator_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /api
# See configuration.py for a list of all supported configuration parameters.
configuration = pdf_generator_client.Configuration(
    host = "/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: api-key
configuration.api_key['api-key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'

# Enter a context with an instance of the API client
with pdf_generator_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pdf_generator_client.PdfTemplateApi(api_client)
    create_pdf_template_dto = pdf_generator_client.CreatePdfTemplateDto() # CreatePdfTemplateDto | 
    limit = 3.4 # float |  (optional)
    offset = 3.4 # float |  (optional)
    order = ['order_example'] # List[str] |  (optional)
    filter = ['filter_example'] # List[str] |  (optional)
    var_or = ['var_or_example'] # List[str] |  (optional)
    expand = ['expand_example'] # List[str] |  (optional)

    try:
        # Create a template
        api_response = api_instance.create(create_pdf_template_dto, limit=limit, offset=offset, order=order, filter=filter, var_or=var_or, expand=expand)
        print("The response of PdfTemplateApi->create:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PdfTemplateApi->create: %s\n" % e)

Parameters

NameTypeDescriptionNotes
create_pdf_template_dtoCreatePdfTemplateDto
limitfloat[optional]
offsetfloat[optional]
orderList[str][optional]
filterList[str][optional]
var_orList[str][optional]
expandList[str][optional]

Return type

PdfTemplate

Authorization

api-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
2XXCreate new PdfTemplate-
4XX-
5XX-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_files

List[TemplateFilesResponseDto] create_files(id)

Upload template files

Upload HTML/CSS/JS files for a template. Send files as multipart form fields keyed by filename.

Example

  • Api Key Authentication (api-key):
import pdf_generator_client
from pdf_generator_client.models.template_files_response_dto import TemplateFilesResponseDto
from pdf_generator_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /api
# See configuration.py for a list of all supported configuration parameters.
configuration = pdf_generator_client.Configuration(
    host = "/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: api-key
configuration.api_key['api-key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'

# Enter a context with an instance of the API client
with pdf_generator_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pdf_generator_client.PdfTemplateApi(api_client)
    id = 'id_example' # str | Template ID

    try:
        # Upload template files
        api_response = api_instance.create_files(id)
        print("The response of PdfTemplateApi->create_files:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PdfTemplateApi->create_files: %s\n" % e)

Parameters

NameTypeDescriptionNotes
idstrTemplate ID

Return type

List[TemplateFilesResponseDto]

Authorization

api-key

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200-
201-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_from_zip

create_from_zip(file=file)

Create template from ZIP

Upload a ZIP archive to create a new template. If a template.yaml is present, its whitelisted settings are applied (including the template name).

Example

  • Api Key Authentication (api-key):
import pdf_generator_client
from pdf_generator_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /api
# See configuration.py for a list of all supported configuration parameters.
configuration = pdf_generator_client.Configuration(
    host = "/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: api-key
configuration.api_key['api-key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'

# Enter a context with an instance of the API client
with pdf_generator_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pdf_generator_client.PdfTemplateApi(api_client)
    file = None # bytes | ZIP file containing template files (optional)

    try:
        # Create template from ZIP
        api_instance.create_from_zip(file=file)
    except Exception as e:
        print("Exception when calling PdfTemplateApi->create_from_zip: %s\n" % e)

Parameters

NameTypeDescriptionNotes
filebytesZIP file containing template files[optional]

Return type

void (empty response body)

Authorization

api-key

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: Not defined

HTTP response details

Status codeDescriptionResponse headers
201Template created from ZIP-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_file

delete_file(id, file)

Delete a file

Delete a file from a template

Example

  • Api Key Authentication (api-key):
import pdf_generator_client
from pdf_generator_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /api
# See configuration.py for a list of all supported configuration parameters.
configuration = pdf_generator_client.Configuration(
    host = "/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: api-key
configuration.api_key['api-key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'

# Enter a context with an instance of the API client
with pdf_generator_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pdf_generator_client.PdfTemplateApi(api_client)
    id = 'id_example' # str | Template ID
    file = None # object | File path relative to template root

    try:
        # Delete a file
        api_instance.delete_file(id, file)
    except Exception as e:
        print("Exception when calling PdfTemplateApi->delete_file: %s\n" % e)

Parameters

NameTypeDescriptionNotes
idstrTemplate ID
fileobjectFile path relative to template root

Return type

void (empty response body)

Authorization

api-key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200File was deleted successfully-
404File not found-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

destroy

destroy(lookup)

Delete a template

Delete a template and all its files (Admin only)

Example

  • Api Key Authentication (api-key):
import pdf_generator_client
from pdf_generator_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /api
# See configuration.py for a list of all supported configuration parameters.
configuration = pdf_generator_client.Configuration(
    host = "/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: api-key
configuration.api_key['api-key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'

# Enter a context with an instance of the API client
with pdf_generator_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pdf_generator_client.PdfTemplateApi(api_client)
    lookup = 3.4 # float | 

    try:
        # Delete a template
        api_instance.destroy(lookup)
    except Exception as e:
        print("Exception when calling PdfTemplateApi->destroy: %s\n" % e)

Parameters

NameTypeDescriptionNotes
lookupfloat

Return type

void (empty response body)

Authorization

api-key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
2XXDelete PdfTemplate by id-
4XX-
5XX-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

export_as_zip

export_as_zip(id)

Export template files as ZIP archive

Download all template files bundled as a ZIP archive. Includes a Content-Disposition header with the template name.

Example

  • Api Key Authentication (api-key):
import pdf_generator_client
from pdf_generator_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /api
# See configuration.py for a list of all supported configuration parameters.
configuration = pdf_generator_client.Configuration(
    host = "/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: api-key
configuration.api_key['api-key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'

# Enter a context with an instance of the API client
with pdf_generator_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pdf_generator_client.PdfTemplateApi(api_client)
    id = 'id_example' # str | Template ID

    try:
        # Export template files as ZIP archive
        api_instance.export_as_zip(id)
    except Exception as e:
        print("Exception when calling PdfTemplateApi->export_as_zip: %s\n" % e)

Parameters

NameTypeDescriptionNotes
idstrTemplate ID

Return type

void (empty response body)

Authorization

api-key

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status codeDescriptionResponse headers
200ZIP file containing template files-
404Template has no files-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_context_schema

GetContextSchema200Response get_context_schema(id)

Get JSON schema for template variables

Returns the JSON schema that can be used to validate variable values for a template

Example

  • Api Key Authentication (api-key):
import pdf_generator_client
from pdf_generator_client.models.get_context_schema200_response import GetContextSchema200Response
from pdf_generator_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /api
# See configuration.py for a list of all supported configuration parameters.
configuration = pdf_generator_client.Configuration(
    host = "/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: api-key
configuration.api_key['api-key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'

# Enter a context with an instance of the API client
with pdf_generator_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pdf_generator_client.PdfTemplateApi(api_client)
    id = 'id_example' # str | Template ID

    try:
        # Get JSON schema for template variables
        api_response = api_instance.get_context_schema(id)
        print("The response of PdfTemplateApi->get_context_schema:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PdfTemplateApi->get_context_schema: %s\n" % e)

Parameters

NameTypeDescriptionNotes
idstrTemplate ID

Return type

GetContextSchema200Response

Authorization

api-key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200-
404Template not found-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_default_values

GetDefaultValues200Response get_default_values(id)

Get template variable default values

Returns the default values and metadata for a template

Example

  • Api Key Authentication (api-key):
import pdf_generator_client
from pdf_generator_client.models.get_default_values200_response import GetDefaultValues200Response
from pdf_generator_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /api
# See configuration.py for a list of all supported configuration parameters.
configuration = pdf_generator_client.Configuration(
    host = "/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: api-key
configuration.api_key['api-key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'

# Enter a context with an instance of the API client
with pdf_generator_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pdf_generator_client.PdfTemplateApi(api_client)
    id = 'id_example' # str | Template ID

    try:
        # Get template variable default values
        api_response = api_instance.get_default_values(id)
        print("The response of PdfTemplateApi->get_default_values:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PdfTemplateApi->get_default_values: %s\n" % e)

Parameters

NameTypeDescriptionNotes
idstrTemplate ID

Return type

GetDefaultValues200Response

Authorization

api-key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200-
404Template not found-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_file_content

bytes get_file_content(id, file, if_none_match=if_none_match)

Download file content

Download a template file by path. Supports ETag-based caching.

Example

  • Api Key Authentication (api-key):
import pdf_generator_client
from pdf_generator_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /api
# See configuration.py for a list of all supported configuration parameters.
configuration = pdf_generator_client.Configuration(
    host = "/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: api-key
configuration.api_key['api-key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'

# Enter a context with an instance of the API client
with pdf_generator_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pdf_generator_client.PdfTemplateApi(api_client)
    id = 'id_example' # str | Template ID
    file = 'file_example' # str | File path relative to template root
    if_none_match = 'if_none_match_example' # str | ETag from previous response for conditional download (optional)

    try:
        # Download file content
        api_response = api_instance.get_file_content(id, file, if_none_match=if_none_match)
        print("The response of PdfTemplateApi->get_file_content:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PdfTemplateApi->get_file_content: %s\n" % e)

Parameters

NameTypeDescriptionNotes
idstrTemplate ID
filestrFile path relative to template root
if_none_matchstrETag from previous response for conditional download[optional]

Return type

bytes

Authorization

api-key

HTTP request headers

  • Content-Type: Not defined
  • Accept: /, application/json

HTTP response details

Status codeDescriptionResponse headers
200-
404File not found-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_file_type

TemplateFile get_file_type(id, file)

Get file type

Get the MIME type of a template file

Example

  • Api Key Authentication (api-key):
import pdf_generator_client
from pdf_generator_client.models.template_file import TemplateFile
from pdf_generator_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /api
# See configuration.py for a list of all supported configuration parameters.
configuration = pdf_generator_client.Configuration(
    host = "/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: api-key
configuration.api_key['api-key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'

# Enter a context with an instance of the API client
with pdf_generator_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pdf_generator_client.PdfTemplateApi(api_client)
    id = 'id_example' # str | Template ID
    file = None # object | File path relative to template root

    try:
        # Get file type
        api_response = api_instance.get_file_type(id, file)
        print("The response of PdfTemplateApi->get_file_type:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PdfTemplateApi->get_file_type: %s\n" % e)

Parameters

NameTypeDescriptionNotes
idstrTemplate ID
fileobjectFile path relative to template root

Return type

TemplateFile

Authorization

api-key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200-
404File not found-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

import_zip

import_zip(id, file=file)

Upload files from ZIP

Upload a ZIP archive containing template files. Files are extracted and stored under the template.

Example

  • Api Key Authentication (api-key):
import pdf_generator_client
from pdf_generator_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /api
# See configuration.py for a list of all supported configuration parameters.
configuration = pdf_generator_client.Configuration(
    host = "/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: api-key
configuration.api_key['api-key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'

# Enter a context with an instance of the API client
with pdf_generator_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pdf_generator_client.PdfTemplateApi(api_client)
    id = 'id_example' # str | Template ID
    file = None # bytes | ZIP file containing template files (optional)

    try:
        # Upload files from ZIP
        api_instance.import_zip(id, file=file)
    except Exception as e:
        print("Exception when calling PdfTemplateApi->import_zip: %s\n" % e)

Parameters

NameTypeDescriptionNotes
idstrTemplate ID
filebytesZIP file containing template files[optional]

Return type

void (empty response body)

Authorization

api-key

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: Not defined

HTTP response details

Status codeDescriptionResponse headers
201-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list

PdfTemplateListResponseDto list(limit=limit, offset=offset, order=order, filter=filter, var_or=var_or, expand=expand)

List templates

Returns a paginated list of PDF templates for the organization

Example

  • Api Key Authentication (api-key):
import pdf_generator_client
from pdf_generator_client.models.pdf_template_list_response_dto import PdfTemplateListResponseDto
from pdf_generator_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /api
# See configuration.py for a list of all supported configuration parameters.
configuration = pdf_generator_client.Configuration(
    host = "/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: api-key
configuration.api_key['api-key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'

# Enter a context with an instance of the API client
with pdf_generator_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pdf_generator_client.PdfTemplateApi(api_client)
    limit = 3.4 # float |  (optional)
    offset = 3.4 # float |  (optional)
    order = ['order_example'] # List[str] |  (optional)
    filter = ['filter_example'] # List[str] |  (optional)
    var_or = ['var_or_example'] # List[str] |  (optional)
    expand = ['expand_example'] # List[str] |  (optional)

    try:
        # List templates
        api_response = api_instance.list(limit=limit, offset=offset, order=order, filter=filter, var_or=var_or, expand=expand)
        print("The response of PdfTemplateApi->list:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PdfTemplateApi->list: %s\n" % e)

Parameters

NameTypeDescriptionNotes
limitfloat[optional]
offsetfloat[optional]
orderList[str][optional]
filterList[str][optional]
var_orList[str][optional]
expandList[str][optional]

Return type

PdfTemplateListResponseDto

Authorization

api-key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
2XXReturns a list of PdfTemplate-
4XX-
5XX-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_files

FileListResultDto list_files(id, start=start, limit=limit, name_filter=name_filter)

List template files

List all files for a template

Example

  • Api Key Authentication (api-key):
import pdf_generator_client
from pdf_generator_client.models.file_list_result_dto import FileListResultDto
from pdf_generator_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /api
# See configuration.py for a list of all supported configuration parameters.
configuration = pdf_generator_client.Configuration(
    host = "/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: api-key
configuration.api_key['api-key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'

# Enter a context with an instance of the API client
with pdf_generator_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pdf_generator_client.PdfTemplateApi(api_client)
    id = 'id_example' # str | Template ID
    start = 'start_example' # str | Pagination start token (optional)
    limit = 3.4 # float | Maximum number of files to return (optional)
    name_filter = 'name_filter_example' # str | Filter by filename (partial match) (optional)

    try:
        # List template files
        api_response = api_instance.list_files(id, start=start, limit=limit, name_filter=name_filter)
        print("The response of PdfTemplateApi->list_files:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PdfTemplateApi->list_files: %s\n" % e)

Parameters

NameTypeDescriptionNotes
idstrTemplate ID
startstrPagination start token[optional]
limitfloatMaximum number of files to return[optional]
name_filterstrFilter by filename (partial match)[optional]

Return type

FileListResultDto

Authorization

api-key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200-
404Template not found-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

render

RenderPdfResultDto render(render_pdf_template_dto)

Render a PDF

Render a PDF from a template. Provide template ID, context variables, and optional metadata. The rendered PDF is saved and its download key is returned.

Example

  • Api Key Authentication (api-key):
import pdf_generator_client
from pdf_generator_client.models.render_pdf_result_dto import RenderPdfResultDto
from pdf_generator_client.models.render_pdf_template_dto import RenderPdfTemplateDto
from pdf_generator_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /api
# See configuration.py for a list of all supported configuration parameters.
configuration = pdf_generator_client.Configuration(
    host = "/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: api-key
configuration.api_key['api-key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'

# Enter a context with an instance of the API client
with pdf_generator_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pdf_generator_client.PdfTemplateApi(api_client)
    render_pdf_template_dto = pdf_generator_client.RenderPdfTemplateDto() # RenderPdfTemplateDto | 

    try:
        # Render a PDF
        api_response = api_instance.render(render_pdf_template_dto)
        print("The response of PdfTemplateApi->render:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PdfTemplateApi->render: %s\n" % e)

Parameters

NameTypeDescriptionNotes
render_pdf_template_dtoRenderPdfTemplateDto

Return type

RenderPdfResultDto

Authorization

api-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200PDF was rendered successfully-
401Invalid or missing API key-
404Template or user not found-
422Validation error in request body-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

replace

PdfTemplate replace(lookup, create_pdf_template_dto, limit=limit, offset=offset, order=order, filter=filter, var_or=var_or, expand=expand)

Replace a template

Fully replace a template (Admin only)

Example

  • Api Key Authentication (api-key):
import pdf_generator_client
from pdf_generator_client.models.create_pdf_template_dto import CreatePdfTemplateDto
from pdf_generator_client.models.pdf_template import PdfTemplate
from pdf_generator_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /api
# See configuration.py for a list of all supported configuration parameters.
configuration = pdf_generator_client.Configuration(
    host = "/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: api-key
configuration.api_key['api-key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'

# Enter a context with an instance of the API client
with pdf_generator_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pdf_generator_client.PdfTemplateApi(api_client)
    lookup = 3.4 # float | 
    create_pdf_template_dto = pdf_generator_client.CreatePdfTemplateDto() # CreatePdfTemplateDto | 
    limit = 3.4 # float |  (optional)
    offset = 3.4 # float |  (optional)
    order = ['order_example'] # List[str] |  (optional)
    filter = ['filter_example'] # List[str] |  (optional)
    var_or = ['var_or_example'] # List[str] |  (optional)
    expand = ['expand_example'] # List[str] |  (optional)

    try:
        # Replace a template
        api_response = api_instance.replace(lookup, create_pdf_template_dto, limit=limit, offset=offset, order=order, filter=filter, var_or=var_or, expand=expand)
        print("The response of PdfTemplateApi->replace:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PdfTemplateApi->replace: %s\n" % e)

Parameters

NameTypeDescriptionNotes
lookupfloat
create_pdf_template_dtoCreatePdfTemplateDto
limitfloat[optional]
offsetfloat[optional]
orderList[str][optional]
filterList[str][optional]
var_orList[str][optional]
expandList[str][optional]

Return type

PdfTemplate

Authorization

api-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
2XXReplace PdfTemplate by id-
4XX-
5XX-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

retrieve

PdfTemplate retrieve(lookup, limit=limit, offset=offset, order=order, filter=filter, var_or=var_or, expand=expand)

Get a template

Get a single PDF template by ID

Example

  • Api Key Authentication (api-key):
import pdf_generator_client
from pdf_generator_client.models.pdf_template import PdfTemplate
from pdf_generator_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /api
# See configuration.py for a list of all supported configuration parameters.
configuration = pdf_generator_client.Configuration(
    host = "/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: api-key
configuration.api_key['api-key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'

# Enter a context with an instance of the API client
with pdf_generator_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pdf_generator_client.PdfTemplateApi(api_client)
    lookup = 3.4 # float | 
    limit = 3.4 # float |  (optional)
    offset = 3.4 # float |  (optional)
    order = ['order_example'] # List[str] |  (optional)
    filter = ['filter_example'] # List[str] |  (optional)
    var_or = ['var_or_example'] # List[str] |  (optional)
    expand = ['expand_example'] # List[str] |  (optional)

    try:
        # Get a template
        api_response = api_instance.retrieve(lookup, limit=limit, offset=offset, order=order, filter=filter, var_or=var_or, expand=expand)
        print("The response of PdfTemplateApi->retrieve:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PdfTemplateApi->retrieve: %s\n" % e)

Parameters

NameTypeDescriptionNotes
lookupfloat
limitfloat[optional]
offsetfloat[optional]
orderList[str][optional]
filterList[str][optional]
var_orList[str][optional]
expandList[str][optional]

Return type

PdfTemplate

Authorization

api-key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
2XXRetrieve PdfTemplate by id-
4XX-
5XX-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update

PdfTemplate update(lookup, update_pdf_template_dto, limit=limit, offset=offset, order=order, filter=filter, var_or=var_or, expand=expand)

Update a template

Partially update a template (Admin only)

Example

  • Api Key Authentication (api-key):
import pdf_generator_client
from pdf_generator_client.models.pdf_template import PdfTemplate
from pdf_generator_client.models.update_pdf_template_dto import UpdatePdfTemplateDto
from pdf_generator_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /api
# See configuration.py for a list of all supported configuration parameters.
configuration = pdf_generator_client.Configuration(
    host = "/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: api-key
configuration.api_key['api-key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'

# Enter a context with an instance of the API client
with pdf_generator_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pdf_generator_client.PdfTemplateApi(api_client)
    lookup = 3.4 # float | 
    update_pdf_template_dto = pdf_generator_client.UpdatePdfTemplateDto() # UpdatePdfTemplateDto | 
    limit = 3.4 # float |  (optional)
    offset = 3.4 # float |  (optional)
    order = ['order_example'] # List[str] |  (optional)
    filter = ['filter_example'] # List[str] |  (optional)
    var_or = ['var_or_example'] # List[str] |  (optional)
    expand = ['expand_example'] # List[str] |  (optional)

    try:
        # Update a template
        api_response = api_instance.update(lookup, update_pdf_template_dto, limit=limit, offset=offset, order=order, filter=filter, var_or=var_or, expand=expand)
        print("The response of PdfTemplateApi->update:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PdfTemplateApi->update: %s\n" % e)

Parameters

NameTypeDescriptionNotes
lookupfloat
update_pdf_template_dtoUpdatePdfTemplateDto
limitfloat[optional]
offsetfloat[optional]
orderList[str][optional]
filterList[str][optional]
var_orList[str][optional]
expandList[str][optional]

Return type

PdfTemplate

Authorization

api-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
2XXUpdate/patch PdfTemplate by id-
4XX-
5XX-

[Back to top] [Back to API list] [Back to Model list] [Back to README]