Skip to content

Latest commit

 

History

History
361 lines (253 loc) · 12.2 KB

File metadata and controls

361 lines (253 loc) · 12.2 KB

pdf_generator_api_client.TemplateVersionsApi

All URIs are relative to https://us1.pdfgeneratorapi.com/api/v4

Method HTTP request Description
delete_template_version DELETE /templates/{templateId}/versions/{templateVersion} Delete template version
get_template_version GET /templates/{templateId}/versions/{templateVersion} Get template version
list_template_versions GET /templates/{templateId}/versions List template versions
promote_template_version PUT /templates/{templateId}/versions/{templateVersion}/promote Promote template version

delete_template_version

delete_template_version(template_id, template_version)

Delete template version

Deletes the specified template version. Production versions cannot be deleted.

Example

  • Bearer (JWT) Authentication (JSONWebTokenAuth):
import pdf_generator_api_client
from pdf_generator_api_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://us1.pdfgeneratorapi.com/api/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = pdf_generator_api_client.Configuration(
    host = "https://us1.pdfgeneratorapi.com/api/v4"
)

# 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 Bearer authorization (JWT): JSONWebTokenAuth
configuration = pdf_generator_api_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with pdf_generator_api_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pdf_generator_api_client.TemplateVersionsApi(api_client)
    template_id = 19375 # int | Template unique identifier
    template_version = 56 # int | Unique ID of the template version.

    try:
        # Delete template version
        api_instance.delete_template_version(template_id, template_version)
    except Exception as e:
        print("Exception when calling TemplateVersionsApi->delete_template_version: %s\n" % e)

Parameters

Name Type Description Notes
template_id int Template unique identifier
template_version int Unique ID of the template version.

Return type

void (empty response body)

Authorization

JSONWebTokenAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 Template version deleted successfully -
401 Unauthorized -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
429 Too Many Requests -
500 Internal Server Error -

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

get_template_version

InlineObject16 get_template_version(template_id, template_version)

Get template version

Returns the template definition of the specified version.

Example

  • Bearer (JWT) Authentication (JSONWebTokenAuth):
import pdf_generator_api_client
from pdf_generator_api_client.models.inline_object16 import InlineObject16
from pdf_generator_api_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://us1.pdfgeneratorapi.com/api/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = pdf_generator_api_client.Configuration(
    host = "https://us1.pdfgeneratorapi.com/api/v4"
)

# 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 Bearer authorization (JWT): JSONWebTokenAuth
configuration = pdf_generator_api_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with pdf_generator_api_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pdf_generator_api_client.TemplateVersionsApi(api_client)
    template_id = 19375 # int | Template unique identifier
    template_version = 56 # int | Unique ID of the template version.

    try:
        # Get template version
        api_response = api_instance.get_template_version(template_id, template_version)
        print("The response of TemplateVersionsApi->get_template_version:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TemplateVersionsApi->get_template_version: %s\n" % e)

Parameters

Name Type Description Notes
template_id int Template unique identifier
template_version int Unique ID of the template version.

Return type

InlineObject16

Authorization

JSONWebTokenAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Template configuration -
401 Unauthorized -
403 Forbidden -
404 Not Found -
422 Cannot delete production template version -
429 Too Many Requests -
500 Internal Server Error -

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

list_template_versions

TemplateVersionCollection list_template_versions(template_id, per_page=per_page, page=page)

List template versions

Returns a paginated list of template versions for the specified template.

Example

  • Bearer (JWT) Authentication (JSONWebTokenAuth):
import pdf_generator_api_client
from pdf_generator_api_client.models.template_version_collection import TemplateVersionCollection
from pdf_generator_api_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://us1.pdfgeneratorapi.com/api/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = pdf_generator_api_client.Configuration(
    host = "https://us1.pdfgeneratorapi.com/api/v4"
)

# 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 Bearer authorization (JWT): JSONWebTokenAuth
configuration = pdf_generator_api_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with pdf_generator_api_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pdf_generator_api_client.TemplateVersionsApi(api_client)
    template_id = 19375 # int | Template unique identifier
    per_page = 56 # int | Number of items per page. (optional)
    page = 56 # int | Page number to return. (optional)

    try:
        # List template versions
        api_response = api_instance.list_template_versions(template_id, per_page=per_page, page=page)
        print("The response of TemplateVersionsApi->list_template_versions:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TemplateVersionsApi->list_template_versions: %s\n" % e)

Parameters

Name Type Description Notes
template_id int Template unique identifier
per_page int Number of items per page. [optional]
page int Page number to return. [optional]

Return type

TemplateVersionCollection

Authorization

JSONWebTokenAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Paginated list of template versions -
401 Unauthorized -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
429 Too Many Requests -
500 Internal Server Error -

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

promote_template_version

PromoteTemplateVersion200Response promote_template_version(template_id, template_version)

Promote template version

Promotes the specified template version to production. Only one version can be production at a time.

Example

  • Bearer (JWT) Authentication (JSONWebTokenAuth):
import pdf_generator_api_client
from pdf_generator_api_client.models.promote_template_version200_response import PromoteTemplateVersion200Response
from pdf_generator_api_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://us1.pdfgeneratorapi.com/api/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = pdf_generator_api_client.Configuration(
    host = "https://us1.pdfgeneratorapi.com/api/v4"
)

# 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 Bearer authorization (JWT): JSONWebTokenAuth
configuration = pdf_generator_api_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with pdf_generator_api_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pdf_generator_api_client.TemplateVersionsApi(api_client)
    template_id = 19375 # int | Template unique identifier
    template_version = 56 # int | Unique ID of the template version.

    try:
        # Promote template version
        api_response = api_instance.promote_template_version(template_id, template_version)
        print("The response of TemplateVersionsApi->promote_template_version:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TemplateVersionsApi->promote_template_version: %s\n" % e)

Parameters

Name Type Description Notes
template_id int Template unique identifier
template_version int Unique ID of the template version.

Return type

PromoteTemplateVersion200Response

Authorization

JSONWebTokenAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Template version promoted successfully -
401 Unauthorized -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
429 Too Many Requests -
500 Internal Server Error -

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