maislurp-client-powershell.maislurp-client-powershell/Api.ContactControllerApi
All URIs are relative to https://api.mailslurp.com
Method | HTTP request | Description |
---|---|---|
New-Contact | POST /contacts | Create a contact |
Invoke-DeleteContact | DELETE /contacts/{contactId} | Delete contact |
Get-AllContacts | GET /contacts/paginated | Get all contacts |
Get-Contact | GET /contacts/{contactId} | Get contact |
Get-ContactVCard | GET /contacts/{contactId}/download | Get contact vCard vcf file |
Get-Contacts | GET /contacts | Get all contacts |
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 -FirstName "FirstName_example" -LastName "LastName_example" -Company "Company_example" -EmailAddresses @("EmailAddresses_example") -Tags @("Tags_example") -MetaData "TODO" -OptOut $false -GroupId "GroupId_example") # 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
Name | Type | Description | Notes |
---|---|---|---|
CreateContactOptions | CreateContactOptions |
Return type
ContactDto (PSCustomObject)
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to ]
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 |
# 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
Name | Type | Description | Notes |
---|---|---|---|
ContactId | String |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to ]
PageContactProjection Get-AllContacts
[-Page]
[-Size]
[-Sort]
[-Since]
[-Before]
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"
$Page = 987 # Int32 | Optional page in list pagination (optional) (default to 0)
$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")
$Since = Get-Date # System.DateTime | Filter by created at after the given timestamp (optional)
$Before = Get-Date # System.DateTime | Filter by created at before the given timestamp (optional)
# Get all contacts
try {
$Result = Get-AllContacts -Page $Page -Size $Size -Sort $Sort -Since $Since -Before $Before
} 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
Name | Type | Description | Notes |
---|---|---|---|
Page | Int32 | Optional page in list pagination | [optional] [default to 0] |
Size | Int32 | Optional page size in list pagination | [optional] [default to 20] |
Sort | String | Optional createdAt sort direction ASC or DESC | [optional] [default to "ASC"] |
Since | System.DateTime | Filter by created at after the given timestamp | [optional] |
Before | System.DateTime | Filter by created at before the given timestamp | [optional] |
Return type
PageContactProjection (PSCustomObject)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to ]
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 |
# 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
Name | Type | Description | Notes |
---|---|---|---|
ContactId | String |
Return type
ContactDto (PSCustomObject)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to ]
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 |
# 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
Name | Type | Description | Notes |
---|---|---|---|
ContactId | String |
Return type
SystemByte[] (PSCustomObject)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to ]
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
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to ]