# mailslurp_client.TemplateControllerApi

All URIs are relative to https://api.mailslurp.com

Method HTTP request Description
create_template POST /templates Create a Template
delete_template DELETE /templates/{TemplateId} Delete Template
get_all_templates GET /templates/paginated Get all Templates in paginated format
get_template GET /templates/{TemplateId} Get Template
get_templates GET /templates Get all Templates

# create_template

TemplateDto create_template(create_template_options)

Create a Template

# Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
    host = "https://api.mailslurp.com"
)
# 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 = mailslurp_client.Configuration(
    host = "https://api.mailslurp.com",
    api_key = {
        'x-api-key': 'YOUR_API_KEY'
    }
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = mailslurp_client.TemplateControllerApi(api_client)
    create_template_options = mailslurp_client.CreateTemplateOptions() # CreateTemplateOptions | createTemplateOptions
    try:
        # Create a Template
        api_response = api_instance.create_template(create_template_options)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling TemplateControllerApi->create_template: %s\n" % e)

# Parameters

Name Type Description Notes
create_template_options CreateTemplateOptions createTemplateOptions

# Return type

TemplateDto

# Authorization

API_KEY

# HTTP request headers

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

# HTTP response details

Status code Description Response headers
201 Created -
401 Unauthorized -
403 Forbidden -
404 Not Found -

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

# delete_template

delete_template(template_id)

Delete Template

# Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
    host = "https://api.mailslurp.com"
)
# 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 = mailslurp_client.Configuration(
    host = "https://api.mailslurp.com",
    api_key = {
        'x-api-key': 'YOUR_API_KEY'
    }
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = mailslurp_client.TemplateControllerApi(api_client)
    template_id = 'template_id_example' # str | TemplateId
    try:
        # Delete Template
        api_instance.delete_template(template_id)
    except ApiException as e:
        print("Exception when calling TemplateControllerApi->delete_template: %s\n" % e)

# Parameters

Name Type Description Notes
template_id str TemplateId

# Return type

void (empty response body)

# Authorization

API_KEY

# HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

# HTTP response details

Status code Description Response headers
204 No Content -
401 Unauthorized -
403 Forbidden -

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

# get_all_templates

PageTemplateProjection get_all_templates(page=page, size=size, sort=sort)

Get all Templates in paginated format

# Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
    host = "https://api.mailslurp.com"
)
# 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 = mailslurp_client.Configuration(
    host = "https://api.mailslurp.com",
    api_key = {
        'x-api-key': 'YOUR_API_KEY'
    }
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = mailslurp_client.TemplateControllerApi(api_client)
    page = 0 # int | Optional page index in inbox list pagination (optional) (default to 0)
size = 20 # int | Optional page size in inbox list pagination (optional) (default to 20)
sort = 'ASC' # str | Optional createdAt sort direction ASC or DESC (optional) (default to 'ASC')
    try:
        # Get all Templates in paginated format
        api_response = api_instance.get_all_templates(page=page, size=size, sort=sort)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling TemplateControllerApi->get_all_templates: %s\n" % e)

# Parameters

Name Type Description Notes
page int Optional page index in inbox list pagination [optional] [default to 0]
size int Optional page size in inbox list pagination [optional] [default to 20]
sort str Optional createdAt sort direction ASC or DESC [optional] [default to 'ASC']

# Return type

PageTemplateProjection

# Authorization

API_KEY

# HTTP request headers

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

# HTTP response details

Status code Description Response headers
200 OK -
401 Unauthorized -
403 Forbidden -
404 Not Found -

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

# get_template

TemplateDto get_template(template_id)

Get Template

# Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
    host = "https://api.mailslurp.com"
)
# 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 = mailslurp_client.Configuration(
    host = "https://api.mailslurp.com",
    api_key = {
        'x-api-key': 'YOUR_API_KEY'
    }
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = mailslurp_client.TemplateControllerApi(api_client)
    template_id = 'template_id_example' # str | TemplateId
    try:
        # Get Template
        api_response = api_instance.get_template(template_id)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling TemplateControllerApi->get_template: %s\n" % e)

# Parameters

Name Type Description Notes
template_id str TemplateId

# Return type

TemplateDto

# Authorization

API_KEY

# HTTP request headers

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

# HTTP response details

Status code Description Response headers
200 OK -
401 Unauthorized -
403 Forbidden -
404 Not Found -

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

# get_templates

list[TemplateProjection] get_templates()

Get all Templates

# Example

  • Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
    host = "https://api.mailslurp.com"
)
# 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 = mailslurp_client.Configuration(
    host = "https://api.mailslurp.com",
    api_key = {
        'x-api-key': 'YOUR_API_KEY'
    }
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = mailslurp_client.TemplateControllerApi(api_client)
    try:
        # Get all Templates
        api_response = api_instance.get_templates()
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling TemplateControllerApi->get_templates: %s\n" % e)

# Parameters

This endpoint does not need any parameter.

# Return type

list[TemplateProjection]

# Authorization

API_KEY

# HTTP request headers

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

# HTTP response details

Status code Description Response headers
200 OK -
401 Unauthorized -
403 Forbidden -
404 Not Found -

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