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

Swagger UI

OpenAPI Spec

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

ClassMethodHTTP requestDescription
DocumentsApideleteDELETE /documents/{lookup}Delete document(s) by name
DocumentsApilistGET /documentsList documents
DocumentsApiretrieveGET /documents/{key}Download a document
PdfTemplateApicreatePOST /pdf-templateCreate a template
PdfTemplateApicreate_filesPOST /pdf-template/{id}/filesUpload template files
PdfTemplateApicreate_from_zipPOST /pdf-template/from-zipCreate template from ZIP
PdfTemplateApidelete_fileDELETE /pdf-template/{id}/files/{file}Delete a file
PdfTemplateApidestroyDELETE /pdf-template/{lookup}Delete a template
PdfTemplateApiexport_as_zipGET /pdf-template/{id}/files/export-zipExport template files as ZIP archive
PdfTemplateApiget_context_schemaGET /pdf-template/{id}/context-schemaGet JSON schema for template variables
PdfTemplateApiget_default_valuesGET /pdf-template/{id}/variables-default-valuesGet template variable default values
PdfTemplateApiget_file_contentGET /pdf-template/{id}/files/content/{file}Download file content
PdfTemplateApiget_file_typeGET /pdf-template/{id}/files/type/{file}Get file type
PdfTemplateApiimport_zipPOST /pdf-template/{id}/files/import-zipUpload files from ZIP
PdfTemplateApilistGET /pdf-templateList templates
PdfTemplateApilist_filesGET /pdf-template/{id}/filesList template files
PdfTemplateApirenderPOST /pdf-template/renderRender a PDF
PdfTemplateApireplacePUT /pdf-template/{lookup}Replace a template
PdfTemplateApiretrieveGET /pdf-template/{lookup}Get a template
PdfTemplateApiupdatePATCH /pdf-template/{lookup}Update a template
TemplateVariablesApicreatePOST /template-variablesCreate a variable
TemplateVariablesApidestroyDELETE /template-variables/{lookup}Delete a variable
TemplateVariablesApilistGET /template-variablesList template variables
TemplateVariablesApireplacePUT /template-variables/{lookup}Replace a variable
TemplateVariablesApiretrieveGET /template-variables/{lookup}Get a variable
TemplateVariablesApiupdatePATCH /template-variables/{lookup}Update a variable

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

api-key

  • Type: API key
  • API key parameter name: Api-Key
  • Location: HTTP header

Author