maislurp-client-powershell.maislurp-client-powershell/Api.WebhookControllerApi

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

MethodHTTP requestDescription
New-WebhookPOST /inboxes/{inboxId}/webhooksAttach a WebHook URL to an inbox
Invoke-DeleteWebhookDELETE /inboxes/{inboxId}/webhooks/{webhookId}Delete and disable a Webhook for an Inbox
Get-AllWebhookResultsGET /webhooks/resultsGet results for all webhooks
Get-AllWebhooksGET /webhooks/paginatedList Webhooks Paginated
Get-InboxWebhooksPaginatedGET /inboxes/{inboxId}/webhooks/paginatedGet paginated webhooks for an Inbox
Get-TestWebhookPayloadGET /webhooks/testGet test webhook payload example. Response content depends on eventName passed. Uses EMAIL_RECEIVED as default.
Get-TestWebhookPayloadEmailOpenedGET /webhooks/test/email-opened-payloadGet webhook test payload for email opened event
Get-TestWebhookPayloadNewAttachmentGET /webhooks/test/new-attachment-payloadGet webhook test payload for new attachment event
Get-TestWebhookPayloadNewContactGET /webhooks/test/new-contact-payloadGet webhook test payload for new contact event
Get-TestWebhookPayloadNewEmailGET /webhooks/test/new-email-payloadGet webhook test payload for new email event
Get-WebhookGET /webhooks/{webhookId}Get a webhook for an Inbox
Get-WebhookResultGET /webhooks/results/{webhookResultId}Get a webhook result for a webhook
Get-WebhookResultsGET /webhooks/{webhookId}/resultsGet a webhook results for a webhook
Get-WebhooksGET /inboxes/{inboxId}/webhooksGet all webhooks for an Inbox
Send-TestDataPOST /webhooks/{webhookId}/testSend webhook test data

New-Webhook

WebhookDto New-Webhook         [-InboxId]         [-WebhookOptions]

Attach a WebHook URL to an inbox

Get notified whenever an inbox receives an email via a WebHook URL. An emailID will be posted to this URL every time an email is received for this inbox. The URL must be publicly reachable by the MailSlurp server. You can provide basicAuth values if you wish to secure this endpoint.

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"

$InboxId = "InboxId_example" # String | inboxId
$WebhookOptions = (Initialize-CreateWebhookOptions -BasicAuth (Initialize-BasicAuthOptions -Username "Username_example" -Password "Password_example") -EventName "EMAIL_RECEIVED" -Name "Name_example" -Url "Url_example") # CreateWebhookOptions | webhookOptions

# Attach a WebHook URL to an inbox
try {
     $Result = New-Webhook -InboxId $InboxId -WebhookOptions $WebhookOptions
} catch {
    Write-Host ("Exception occured when calling New-Webhook: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
InboxIdStringinboxId
WebhookOptionsCreateWebhookOptionswebhookOptions

Return type

WebhookDto (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-DeleteWebhook

void Invoke-DeleteWebhook         [-InboxId]         [-WebhookId]

Delete and disable a Webhook for an Inbox

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"

$InboxId = "InboxId_example" # String | inboxId
$WebhookId = "WebhookId_example" # String | webhookId

# Delete and disable a Webhook for an Inbox
try {
     $Result = Invoke-DeleteWebhook -InboxId $InboxId -WebhookId $WebhookId
} catch {
    Write-Host ("Exception occured when calling Invoke-DeleteWebhook: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
InboxIdStringinboxId
WebhookIdStringwebhookId

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-AllWebhookResults

PageWebhookResult Get-AllWebhookResults         [-Page] <System.Nullable[Int32]>         [-SearchFilter]         [-Size] <System.Nullable[Int32]>         [-Sort]

Get results for all webhooks

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"

$Page = 987 # Int32 | Optional page  in list pagination (optional) (default to 0)
$SearchFilter = "SearchFilter_example" # String | Optional search filter (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 results for all webhooks
try {
     $Result = Get-AllWebhookResults -Page $Page -SearchFilter $SearchFilter -Size $Size -Sort $Sort
} catch {
    Write-Host ("Exception occured when calling Get-AllWebhookResults: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
PageInt32Optional page in list pagination[optional] [default to 0]
SearchFilterStringOptional search filter[optional]
SizeInt32Optional page size in list pagination[optional] [default to 20]
SortStringOptional createdAt sort direction ASC or DESC[optional] [default to “ASC”]

Return type

PageWebhookResult (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-AllWebhooks

PageWebhookProjection Get-AllWebhooks         [-Page] <System.Nullable[Int32]>         [-SearchFilter]         [-Size] <System.Nullable[Int32]>         [-Sort]

List Webhooks Paginated

List webhooks in paginated form. Allows for page , page size, and sort direction.

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"

$Page = 987 # Int32 | Optional page  in list pagination (optional) (default to 0)
$SearchFilter = "SearchFilter_example" # String | Optional search filter (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")

# List Webhooks Paginated
try {
     $Result = Get-AllWebhooks -Page $Page -SearchFilter $SearchFilter -Size $Size -Sort $Sort
} catch {
    Write-Host ("Exception occured when calling Get-AllWebhooks: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
PageInt32Optional page in list pagination[optional] [default to 0]
SearchFilterStringOptional search filter[optional]
SizeInt32Optional page size in list pagination[optional] [default to 20]
SortStringOptional createdAt sort direction ASC or DESC[optional] [default to “ASC”]

Return type

PageWebhookProjection (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-InboxWebhooksPaginated

PageWebhookProjection Get-InboxWebhooksPaginated         [-InboxId]         [-Page] <System.Nullable[Int32]>         [-SearchFilter]         [-Size] <System.Nullable[Int32]>         [-Sort]

Get paginated webhooks for an Inbox

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"

$InboxId = "InboxId_example" # String | inboxId
$Page = 987 # Int32 | Optional page  in list pagination (optional) (default to 0)
$SearchFilter = "SearchFilter_example" # String | Optional search filter (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 paginated webhooks for an Inbox
try {
     $Result = Get-InboxWebhooksPaginated -InboxId $InboxId -Page $Page -SearchFilter $SearchFilter -Size $Size -Sort $Sort
} catch {
    Write-Host ("Exception occured when calling Get-InboxWebhooksPaginated: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
InboxIdStringinboxId
PageInt32Optional page in list pagination[optional] [default to 0]
SearchFilterStringOptional search filter[optional]
SizeInt32Optional page size in list pagination[optional] [default to 20]
SortStringOptional createdAt sort direction ASC or DESC[optional] [default to “ASC”]

Return type

PageWebhookProjection (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-TestWebhookPayload

AbstractWebhookPayload Get-TestWebhookPayload         [-EventName]

Get test webhook payload example. Response content depends on eventName passed. Uses EMAIL_RECEIVED as default.

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"

$EventName = "EMAIL_RECEIVED" # String | eventName (optional)

# Get test webhook payload example. Response content depends on eventName passed. Uses `EMAIL_RECEIVED` as default.
try {
     $Result = Get-TestWebhookPayload -EventName $EventName
} catch {
    Write-Host ("Exception occured when calling Get-TestWebhookPayload: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
EventNameStringeventName[optional]

Return type

AbstractWebhookPayload (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-TestWebhookPayloadEmailOpened

WebhookEmailOpenedPayload Get-TestWebhookPayloadEmailOpened

Get webhook test payload for email opened event

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 webhook test payload for email opened event
try {
     $Result = Get-TestWebhookPayloadEmailOpened
} catch {
    Write-Host ("Exception occured when calling Get-TestWebhookPayloadEmailOpened: {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

WebhookEmailOpenedPayload (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-TestWebhookPayloadNewAttachment

WebhookNewAttachmentPayload Get-TestWebhookPayloadNewAttachment

Get webhook test payload for new attachment event

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 webhook test payload for new attachment event
try {
     $Result = Get-TestWebhookPayloadNewAttachment
} catch {
    Write-Host ("Exception occured when calling Get-TestWebhookPayloadNewAttachment: {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

WebhookNewAttachmentPayload (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-TestWebhookPayloadNewContact

WebhookNewContactPayload Get-TestWebhookPayloadNewContact

Get webhook test payload for new contact event

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 webhook test payload for new contact event
try {
     $Result = Get-TestWebhookPayloadNewContact
} catch {
    Write-Host ("Exception occured when calling Get-TestWebhookPayloadNewContact: {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

WebhookNewContactPayload (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-TestWebhookPayloadNewEmail

WebhookNewEmailPayload Get-TestWebhookPayloadNewEmail

Get webhook test payload for new email event

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 webhook test payload for new email event
try {
     $Result = Get-TestWebhookPayloadNewEmail
} catch {
    Write-Host ("Exception occured when calling Get-TestWebhookPayloadNewEmail: {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

WebhookNewEmailPayload (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-Webhook

WebhookDto Get-Webhook         [-WebhookId]

Get a webhook for an Inbox

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"

$WebhookId = "WebhookId_example" # String | webhookId

# Get a webhook for an Inbox
try {
     $Result = Get-Webhook -WebhookId $WebhookId
} catch {
    Write-Host ("Exception occured when calling Get-Webhook: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
WebhookIdStringwebhookId

Return type

WebhookDto (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-WebhookResult

WebhookResultEntity Get-WebhookResult         [-WebhookResultId]

Get a webhook result for a webhook

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"

$WebhookResultId = "WebhookResultId_example" # String | Webhook Result ID

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

Parameters

NameTypeDescriptionNotes
WebhookResultIdStringWebhook Result ID

Return type

WebhookResultEntity (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-WebhookResults

PageWebhookResult Get-WebhookResults         [-WebhookId]         [-Page] <System.Nullable[Int32]>         [-SearchFilter]         [-Size] <System.Nullable[Int32]>         [-Sort]

Get a webhook results for a webhook

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"

$WebhookId = "WebhookId_example" # String | ID of webhook to get results for
$Page = 987 # Int32 | Optional page  in list pagination (optional) (default to 0)
$SearchFilter = "SearchFilter_example" # String | Optional search filter (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 a webhook results for a webhook
try {
     $Result = Get-WebhookResults -WebhookId $WebhookId -Page $Page -SearchFilter $SearchFilter -Size $Size -Sort $Sort
} catch {
    Write-Host ("Exception occured when calling Get-WebhookResults: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
WebhookIdStringID of webhook to get results for
PageInt32Optional page in list pagination[optional] [default to 0]
SearchFilterStringOptional search filter[optional]
SizeInt32Optional page size in list pagination[optional] [default to 20]
SortStringOptional createdAt sort direction ASC or DESC[optional] [default to “ASC”]

Return type

PageWebhookResult (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-Webhooks

WebhookDto[] Get-Webhooks         [-InboxId]

Get all webhooks for an Inbox

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"

$InboxId = "InboxId_example" # String | inboxId

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

Parameters

NameTypeDescriptionNotes
InboxIdStringinboxId

Return type

**WebhookDto[]** (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 ]

Send-TestData

WebhookTestResult Send-TestData         [-WebhookId]

Send webhook test data

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"

$WebhookId = "WebhookId_example" # String | webhookId

# Send webhook test data
try {
     $Result = Send-TestData -WebhookId $WebhookId
} catch {
    Write-Host ("Exception occured when calling Send-TestData: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
WebhookIdStringwebhookId

Return type

WebhookTestResult (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 ]