pdf_generator_client.PdfTemplateApi
All URIs are relative to /api
| Method | HTTP request | Description |
|---|---|---|
| create | POST /pdf-template | Create a template |
| create_files | POST /pdf-template/{id}/files | Upload template files |
| create_from_zip | POST /pdf-template/from-zip | Create template from ZIP |
| delete_file | DELETE /pdf-template/{id}/files/{file} | Delete a file |
| destroy | DELETE /pdf-template/{lookup} | Delete a template |
| export_as_zip | GET /pdf-template/{id}/files/export-zip | Export template files as ZIP archive |
| get_context_schema | GET /pdf-template/{id}/context-schema | Get JSON schema for template variables |
| get_default_values | GET /pdf-template/{id}/variables-default-values | Get template variable default values |
| get_file_content | GET /pdf-template/{id}/files/content/{file} | Download file content |
| get_file_type | GET /pdf-template/{id}/files/type/{file} | Get file type |
| import_zip | POST /pdf-template/{id}/files/import-zip | Upload files from ZIP |
| list | GET /pdf-template | List templates |
| list_files | GET /pdf-template/{id}/files | List template files |
| render | POST /pdf-template/render | Render a PDF |
| replace | PUT /pdf-template/{lookup} | Replace a template |
| retrieve | GET /pdf-template/{lookup} | Get a template |
| update | PATCH /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
| Name | Type | Description | Notes |
|---|---|---|---|
| create_pdf_template_dto | CreatePdfTemplateDto | ||
| limit | float | [optional] | |
| offset | float | [optional] | |
| order | List[str] | [optional] | |
| filter | List[str] | [optional] | |
| var_or | List[str] | [optional] | |
| expand | List[str] | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 2XX | Create 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
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | Template ID |
Return type
List[TemplateFilesResponseDto]
Authorization
HTTP request headers
- Content-Type: multipart/form-data
- Accept: application/json
HTTP response details
| Status code | Description | Response 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
| Name | Type | Description | Notes |
|---|---|---|---|
| file | bytes | ZIP file containing template files | [optional] |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: multipart/form-data
- Accept: Not defined
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 201 | Template 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
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | Template ID | |
| file | object | File path relative to template root |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | File was deleted successfully | - |
| 404 | File 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
| Name | Type | Description | Notes |
|---|---|---|---|
| lookup | float |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 2XX | Delete 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
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | Template ID |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | ZIP file containing template files | - |
| 404 | Template 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
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | Template ID |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | - | |
| 404 | Template 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
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | Template ID |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | - | |
| 404 | Template 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
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | Template ID | |
| file | str | File path relative to template root | |
| if_none_match | str | ETag from previous response for conditional download | [optional] |
Return type
bytes
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /, application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | - | |
| 404 | File 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
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | Template ID | |
| file | object | File path relative to template root |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | - | |
| 404 | File 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
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | Template ID | |
| file | bytes | ZIP file containing template files | [optional] |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: multipart/form-data
- Accept: Not defined
HTTP response details
| Status code | Description | Response 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
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | float | [optional] | |
| offset | float | [optional] | |
| order | List[str] | [optional] | |
| filter | List[str] | [optional] | |
| var_or | List[str] | [optional] | |
| expand | List[str] | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 2XX | Returns 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
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | Template ID | |
| start | str | Pagination start token | [optional] |
| limit | float | Maximum number of files to return | [optional] |
| name_filter | str | Filter by filename (partial match) | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | - | |
| 404 | Template 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
| Name | Type | Description | Notes |
|---|---|---|---|
| render_pdf_template_dto | RenderPdfTemplateDto |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | PDF was rendered successfully | - |
| 401 | Invalid or missing API key | - |
| 404 | Template or user not found | - |
| 422 | Validation 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
| Name | Type | Description | Notes |
|---|---|---|---|
| lookup | float | ||
| create_pdf_template_dto | CreatePdfTemplateDto | ||
| limit | float | [optional] | |
| offset | float | [optional] | |
| order | List[str] | [optional] | |
| filter | List[str] | [optional] | |
| var_or | List[str] | [optional] | |
| expand | List[str] | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 2XX | Replace 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
| Name | Type | Description | Notes |
|---|---|---|---|
| lookup | float | ||
| limit | float | [optional] | |
| offset | float | [optional] | |
| order | List[str] | [optional] | |
| filter | List[str] | [optional] | |
| var_or | List[str] | [optional] | |
| expand | List[str] | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 2XX | Retrieve 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
| Name | Type | Description | Notes |
|---|---|---|---|
| lookup | float | ||
| update_pdf_template_dto | UpdatePdfTemplateDto | ||
| limit | float | [optional] | |
| offset | float | [optional] | |
| order | List[str] | [optional] | |
| filter | List[str] | [optional] | |
| var_or | List[str] | [optional] | |
| expand | List[str] | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 2XX | Update/patch PdfTemplate by id | - |
| 4XX | - | |
| 5XX | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]