# TemplateControllerAPI

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

Method HTTP request Description
createTemplate POST /templates Create a Template
deleteTemplate DELETE /templates/{TemplateId} Delete Template
getAllTemplates GET /templates/paginated Get all Templates in paginated format
getTemplate GET /templates/{TemplateId} Get Template
getTemplates GET /templates Get all Templates

# createTemplate

    open class func createTemplate(createTemplateOptions: CreateTemplateOptions, completion: @escaping (_ data: TemplateDto?, _ error: Error?) -> Void)

Create a Template

# Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp
let createTemplateOptions = CreateTemplateOptions(name: "name_example", content: "content_example") // CreateTemplateOptions | createTemplateOptions
// Create a Template
TemplateControllerAPI.createTemplate(createTemplateOptions: createTemplateOptions) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }
    if (response) {
        dump(response)
    }
}

# Parameters

Name Type Description Notes
createTemplateOptions CreateTemplateOptions createTemplateOptions

# Return type

TemplateDto

# Authorization

API_KEY

# HTTP request headers

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

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

# deleteTemplate

    open class func deleteTemplate(templateId: UUID, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)

Delete Template

# Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp
let templateId = 987 // UUID | TemplateId
// Delete Template
TemplateControllerAPI.deleteTemplate(templateId: templateId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }
    if (response) {
        dump(response)
    }
}

# Parameters

Name Type Description Notes
templateId UUID TemplateId

# Return type

Void (empty response body)

# Authorization

API_KEY

# HTTP request headers

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

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

# getAllTemplates

    open class func getAllTemplates(page: Int? = nil, size: Int? = nil, sort: Sort_getAllTemplates? = nil, completion: @escaping (_ data: PageTemplateProjection?, _ error: Error?) -> Void)

Get all Templates in paginated format

# Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp
let page = 987 // Int | Optional page index in inbox list pagination (optional) (default to 0)
let size = 987 // Int | Optional page size in inbox list pagination (optional) (default to 20)
let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc)
// Get all Templates in paginated format
TemplateControllerAPI.getAllTemplates(page: page, size: size, sort: sort) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }
    if (response) {
        dump(response)
    }
}

# 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 String 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

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

# getTemplate

    open class func getTemplate(templateId: UUID, completion: @escaping (_ data: TemplateDto?, _ error: Error?) -> Void)

Get Template

# Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp
let templateId = 987 // UUID | TemplateId
// Get Template
TemplateControllerAPI.getTemplate(templateId: templateId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }
    if (response) {
        dump(response)
    }
}

# Parameters

Name Type Description Notes
templateId UUID TemplateId

# Return type

TemplateDto

# Authorization

API_KEY

# HTTP request headers

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

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

# getTemplates

    open class func getTemplates(completion: @escaping (_ data: [TemplateProjection]?, _ error: Error?) -> Void)

Get all Templates

# Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp
// Get all Templates
TemplateControllerAPI.getTemplates() { (response, error) in
    guard error == nil else {
        print(error)
        return
    }
    if (response) {
        dump(response)
    }
}

# Parameters

This endpoint does not need any parameter.

# Return type

[TemplateProjection]

# Authorization

API_KEY

# HTTP request headers

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

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