maislurp-client-powershell.maislurp-client-powershell/Api.ContactControllerApi

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

MethodHTTP requestDescription
New-ContactPOST /contactsCreate a contact
Invoke-DeleteContactDELETE /contacts/{contactId}Delete contact
Get-AllContactsGET /contacts/paginatedGet all contacts
Get-ContactGET /contacts/{contactId}Get contact
Get-ContactVCardGET /contacts/{contactId}/downloadGet contact vCard vcf file
Get-ContactsGET /contactsGet all contacts

New-Contact

ContactDto New-Contact         [-CreateContactOptions]

Create a contact

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"

$CreateContactOptions = (Initialize-CreateContactOptions -EmailAddresses @("EmailAddresses_example") -FirstName "FirstName_example" -GroupId "GroupId_example" -MetaData "TODO" -OptOut $false -Tags @("Tags_example") -LastName "LastName_example" -Company "Company_example") # CreateContactOptions | createContactOptions

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

Parameters

NameTypeDescriptionNotes
CreateContactOptionsCreateContactOptionscreateContactOptions

Return type

ContactDto (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-DeleteContact

void Invoke-DeleteContact         [-ContactId]

Delete contact

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"

$ContactId = "ContactId_example" # String | contactId

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

Parameters

NameTypeDescriptionNotes
ContactIdStringcontactId

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

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

Get all contacts

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 contacts
try {
     $Result = Get-AllContacts -Before $Before -Page $Page -Since $Since -Size $Size -Sort $Sort
} catch {
    Write-Host ("Exception occured when calling Get-AllContacts: {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

PageContactProjection (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-Contact

ContactDto Get-Contact         [-ContactId]

Get contact

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"

$ContactId = "ContactId_example" # String | contactId

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

Parameters

NameTypeDescriptionNotes
ContactIdStringcontactId

Return type

ContactDto (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-ContactVCard

SystemByte Get-ContactVCard         [-ContactId]

Get contact vCard vcf file

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"

$ContactId = "ContactId_example" # String | contactId

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

Parameters

NameTypeDescriptionNotes
ContactIdStringcontactId

Return type

SystemByte (PSCustomObject)

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/octet-stream

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

Get-Contacts

ContactProjection[] Get-Contacts

Get all contacts

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 contacts
try {
     $Result = Get-Contacts
} catch {
    Write-Host ("Exception occured when calling Get-Contacts: {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

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