pdf_generator_client.DocumentsApi

All URIs are relative to /api

MethodHTTP requestDescription
deleteDELETE /documents/{lookup}Delete document(s) by name
listGET /documentsList documents
retrieveGET /documents/{key}Download a document

delete

delete(lookup)

Delete document(s) by name

Deletes generated PDF documents by name, all documents with this name are deleted.

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.DocumentsApi(api_client)
    lookup = 'lookup_example' # str | Document filename

    try:
        # Delete document(s) by name
        api_instance.delete(lookup)
    except Exception as e:
        print("Exception when calling DocumentsApi->delete: %s\n" % e)

Parameters

NameTypeDescriptionNotes
lookupstrDocument filename

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
204Document deleted-
404Document not found-

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

list

ListDocumentsResponseDto list(start_offset=start_offset, limit=limit, name_filter=name_filter, template=template, start=start)

List documents

List generated PDF documents for the organization with pagination and optional filtering.

Example

  • Api Key Authentication (api-key):
import pdf_generator_client
from pdf_generator_client.models.list_documents_response_dto import ListDocumentsResponseDto
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)
    start_offset = '0' # str | Pagination offset (0-based), use the startOffset from the previous response (optional)
    limit = 100 # float | Maximum number of documents to return (default 100) (optional)
    name_filter = 'invoice' # str | Partial match filter on document name (optional)
    template = 1 # float | Filter by template ID (optional)
    start = None # object | Pagination offset (0-based) (optional)

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

Parameters

NameTypeDescriptionNotes
start_offsetstrPagination offset (0-based), use the startOffset from the previous response[optional]
limitfloatMaximum number of documents to return (default 100)[optional]
name_filterstrPartial match filter on document name[optional]
templatefloatFilter by template ID[optional]
startobjectPagination offset (0-based)[optional]

Return type

ListDocumentsResponseDto

Authorization

api-key

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200-

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

retrieve

bytes retrieve(key, dl=dl)

Download a document

Download a generated PDF document by its filename key.

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.DocumentsApi(api_client)
    key = 'key_example' # str | Document filename key
    dl = 'dl_example' # str | Set to \"1\" to force download with Content-Disposition attachment header (optional)

    try:
        # Download a document
        api_response = api_instance.retrieve(key, dl=dl)
        print("The response of DocumentsApi->retrieve:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DocumentsApi->retrieve: %s\n" % e)

Parameters

NameTypeDescriptionNotes
keystrDocument filename key
dlstrSet to "1" to force download with Content-Disposition attachment header[optional]

Return type

bytes

Authorization

api-key

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200-
404Document not found-

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