maislurp-client-powershell.maislurp-client-powershell/Api.TemplateControllerApi

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

MethodHTTP requestDescription
New-TemplatePOST /templatesCreate a Template
Invoke-DeleteTemplateDELETE /templates/{templateId}Delete Template
Get-AllTemplatesGET /templates/paginatedGet all Templates in paginated format
Get-TemplateGET /templates/{templateId}Get Template
Get-TemplatesGET /templatesGet all Templates
Update-TemplatePUT /templates/{templateId}Update a Template

New-Template

TemplateDto New-Template         [-CreateTemplateOptions]

Create a Template

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$CreateTemplateOptions = (Initialize-CreateTemplateOptions -Name "Name_example" -Content "Content_example") # CreateTemplateOptions | createTemplateOptions

# Create a Template
try {
     $Result = New-Template -CreateTemplateOptions $CreateTemplateOptions
} catch {
    Write-Host ("Exception occured when calling New-Template: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
CreateTemplateOptionsCreateTemplateOptionscreateTemplateOptions

Return type

TemplateDto (PSCustomObject)

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 ]

Invoke-DeleteTemplate

void Invoke-DeleteTemplate         [-TemplateId]

Delete Template

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$TemplateId = "TemplateId_example" # String | templateId

# Delete Template
try {
     $Result = Invoke-DeleteTemplate -TemplateId $TemplateId
} catch {
    Write-Host ("Exception occured when calling Invoke-DeleteTemplate: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
TemplateIdStringtemplateId

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 ]

Get-AllTemplates

PageTemplateProjection Get-AllTemplates         [-Before] <System.Nullable[System.DateTime]>         [-Page] <System.Nullable[Int32]>         [-Since] <System.Nullable[System.DateTime]>         [-Size] <System.Nullable[Int32]>         [-Sort]

Get all Templates in paginated format

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$Before = Get-Date # System.DateTime | Filter by created at before the given timestamp (optional)
$Page = 987 # Int32 | Optional page  in list pagination (optional) (default to 0)
$Since = Get-Date # System.DateTime | Filter by created at after the given timestamp (optional)
$Size = 987 # Int32 | Optional page size in list pagination (optional) (default to 20)
$Sort = "ASC" # String | Optional createdAt sort direction ASC or DESC (optional) (default to "ASC")

# Get all Templates in paginated format
try {
     $Result = Get-AllTemplates -Before $Before -Page $Page -Since $Since -Size $Size -Sort $Sort
} catch {
    Write-Host ("Exception occured when calling Get-AllTemplates: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
BeforeSystem.DateTimeFilter by created at before the given timestamp[optional]
PageInt32Optional page in list pagination[optional] [default to 0]
SinceSystem.DateTimeFilter by created at after the given timestamp[optional]
SizeInt32Optional page size in list pagination[optional] [default to 20]
SortStringOptional createdAt sort direction ASC or DESC[optional] [default to “ASC”]

Return type

PageTemplateProjection (PSCustomObject)

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 ]

Get-Template

TemplateDto Get-Template         [-TemplateId]

Get Template

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$TemplateId = "TemplateId_example" # String | templateId

# Get Template
try {
     $Result = Get-Template -TemplateId $TemplateId
} catch {
    Write-Host ("Exception occured when calling Get-Template: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
TemplateIdStringtemplateId

Return type

TemplateDto (PSCustomObject)

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 ]

Get-Templates

TemplateProjection[] Get-Templates

Get all Templates

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"


# Get all Templates
try {
     $Result = Get-Templates
} catch {
    Write-Host ("Exception occured when calling Get-Templates: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

This endpoint does not need any parameter.

Return type

**TemplateProjection[]** (PSCustomObject)

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 ]

Update-Template

TemplateDto Update-Template         [-TemplateId]         [-CreateTemplateOptions]

Update a Template

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$TemplateId = "TemplateId_example" # String | templateId
$CreateTemplateOptions = (Initialize-CreateTemplateOptions -Name "Name_example" -Content "Content_example") # CreateTemplateOptions | createTemplateOptions

# Update a Template
try {
     $Result = Update-Template -TemplateId $TemplateId -CreateTemplateOptions $CreateTemplateOptions
} catch {
    Write-Host ("Exception occured when calling Update-Template: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
TemplateIdStringtemplateId
CreateTemplateOptionsCreateTemplateOptionscreateTemplateOptions

Return type

TemplateDto (PSCustomObject)

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 ]