pdf-generator-client
Cloud-based PDF generation API. Create, manage, and render PDF templates programmatically.
Authentication
All API requests require an API key. Pass it in the Api-Key header:
Api-Key: pk_your_api_key_here
Generate and manage your API keys from your account settings.
Base URL
https://app.generator.rest/api
Swagger UI available at
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 1.0
- Package version: 1.0.0
- Generator version: 7.23.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
Requirements.
Python 3.10+
Installation & Usage
pip install
If the python package is hosted on a repository, you can install directly using:
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)
Then import the package:
import pdf_generator_client
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install to install the package for all users)
Then import the package:
import pdf_generator_client
Tests
Execute pytest to run the tests.
Getting Started
Please follow the installation procedure and then run the following:
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.DocumentsApi(api_client)
lookup = 'lookup_example' # str | Document filename
try:
# Delete document(s) by name
api_instance.delete(lookup)
except ApiException as e:
print("Exception when calling DocumentsApi->delete: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to /api
| Class | Method | HTTP request | Description |
|---|---|---|---|
| DocumentsApi | delete | DELETE /documents/{lookup} | Delete document(s) by name |
| DocumentsApi | list | GET /documents | List documents |
| DocumentsApi | retrieve | GET /documents/{key} | Download a document |
| PdfTemplateApi | create | POST /pdf-template | Create a template |
| PdfTemplateApi | create_files | POST /pdf-template/{id}/files | Upload template files |
| PdfTemplateApi | create_from_zip | POST /pdf-template/from-zip | Create template from ZIP |
| PdfTemplateApi | delete_file | DELETE /pdf-template/{id}/files/{file} | Delete a file |
| PdfTemplateApi | destroy | DELETE /pdf-template/{lookup} | Delete a template |
| PdfTemplateApi | export_as_zip | GET /pdf-template/{id}/files/export-zip | Export template files as ZIP archive |
| PdfTemplateApi | get_context_schema | GET /pdf-template/{id}/context-schema | Get JSON schema for template variables |
| PdfTemplateApi | get_default_values | GET /pdf-template/{id}/variables-default-values | Get template variable default values |
| PdfTemplateApi | get_file_content | GET /pdf-template/{id}/files/content/{file} | Download file content |
| PdfTemplateApi | get_file_type | GET /pdf-template/{id}/files/type/{file} | Get file type |
| PdfTemplateApi | import_zip | POST /pdf-template/{id}/files/import-zip | Upload files from ZIP |
| PdfTemplateApi | list | GET /pdf-template | List templates |
| PdfTemplateApi | list_files | GET /pdf-template/{id}/files | List template files |
| PdfTemplateApi | render | POST /pdf-template/render | Render a PDF |
| PdfTemplateApi | replace | PUT /pdf-template/{lookup} | Replace a template |
| PdfTemplateApi | retrieve | GET /pdf-template/{lookup} | Get a template |
| PdfTemplateApi | update | PATCH /pdf-template/{lookup} | Update a template |
| TemplateVariablesApi | create | POST /template-variables | Create a variable |
| TemplateVariablesApi | destroy | DELETE /template-variables/{lookup} | Delete a variable |
| TemplateVariablesApi | list | GET /template-variables | List template variables |
| TemplateVariablesApi | replace | PUT /template-variables/{lookup} | Replace a variable |
| TemplateVariablesApi | retrieve | GET /template-variables/{lookup} | Get a variable |
| TemplateVariablesApi | update | PATCH /template-variables/{lookup} | Update a variable |
Documentation For Models
- CreatePdfTemplateDto
- CreatePdfTemplateDtoDefaults
- CreateTemplateVariableDto
- ErrorResponse
- FileListResultDto
- FileListResultDtoEntriesInner
- GetContextSchema200Response
- GetDefaultValues200Response
- HttpErrorDto
- ListDocumentsResponseDto
- ListDocumentsResponseDtoEntriesInner
- ListDocumentsResponseDtoEntriesInnerTemplate
- Margin
- Organization
- PdfMetadata
- PdfMetadataInfo
- PdfMetadataXmp
- PdfTemplate
- PdfTemplateListResponseDto
- PdfTemplateUserProperties
- RenderPdfResultDto
- RenderPdfTemplateDto
- TemplateFile
- TemplateFilesResponseDto
- TemplateVariable
- TemplateVariableDataOptions
- TemplateVariableListResponseDto
- UpdatePdfTemplateDto
- UpdateTemplateVariableDto
Documentation For Authorization
Authentication schemes defined for the API:
api-key
- Type: API key
- API key parameter name: Api-Key
- Location: HTTP header