Skip to content

maislurp-client-powershell.maislurp-client-powershell/Api.GroupControllerApi

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

Method HTTP request Description
Add-ContactsToGroup PUT /groups/{groupId}/contacts Add contacts to a group
New-Group POST /groups Create a group
Invoke-DeleteGroup DELETE /groups/{groupId} Delete group
Get-AllGroups GET /groups/paginated Get all Contact Groups in paginated format
Get-Group GET /groups/{groupId} Get group
Get-GroupWithContacts GET /groups/{groupId}/contacts Get group and contacts belonging to it
Get-GroupWithContactsPaginated GET /groups/{groupId}/contacts-paginated
Get-Groups GET /groups Get all groups
Remove-ContactsFromGroup DELETE /groups/{groupId}/contacts Remove contacts from a group

GroupContactsDto Add-ContactsToGroup
        [-GroupId]
        [-UpdateGroupContacts]

Add contacts to a group

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"

$GroupId = "GroupId_example" # String | 
$UpdateGroupContacts = (Initialize-UpdateGroupContacts -ContactIds @("ContactIds_example")) # UpdateGroupContacts | 

# Add contacts to a group
try {
     $Result = Add-ContactsToGroup -GroupId $GroupId -UpdateGroupContacts $UpdateGroupContacts
} catch {
    Write-Host ("Exception occured when calling Add-ContactsToGroup: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
GroupId String
UpdateGroupContacts UpdateGroupContacts

Return type

GroupContactsDto (PSCustomObject)

Authorization

API_KEY

HTTP request headers

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

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

GroupDto New-Group
        [-CreateGroupOptions]

Create a group

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"

$CreateGroupOptions = (Initialize-CreateGroupOptions -Name "Name_example" -Description "Description_example") # CreateGroupOptions | 

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

Parameters

Name Type Description Notes
CreateGroupOptions CreateGroupOptions

Return type

GroupDto (PSCustomObject)

Authorization

API_KEY

HTTP request headers

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

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

void Invoke-DeleteGroup
        [-GroupId]

Delete group

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"

$GroupId = "GroupId_example" # String | 

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

Parameters

Name Type Description Notes
GroupId String

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 ]

PageGroupProjection Get-AllGroups
        [-Page]
        [-Size]
        [-Sort]
        [-Since]
        [-Before]

Get all Contact Groups 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"

$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 Contact Groups in paginated format
try {
     $Result = Get-AllGroups -Page $Page -Size $Size -Sort $Sort -Since $Since -Before $Before
} catch {
    Write-Host ("Exception occured when calling Get-AllGroups: {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

PageGroupProjection (PSCustomObject)

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

GroupDto Get-Group
        [-GroupId]

Get group

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"

$GroupId = "GroupId_example" # String | 

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

Parameters

Name Type Description Notes
GroupId String

Return type

GroupDto (PSCustomObject)

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

GroupContactsDto Get-GroupWithContacts
        [-GroupId]

Get group and contacts belonging to it

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"

$GroupId = "GroupId_example" # String | 

# Get group and contacts belonging to it
try {
     $Result = Get-GroupWithContacts -GroupId $GroupId
} catch {
    Write-Host ("Exception occured when calling Get-GroupWithContacts: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
GroupId String

Return type

GroupContactsDto (PSCustomObject)

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

PageContactProjection Get-GroupWithContactsPaginated
        [-GroupId]
        [-Page]
        [-Size]
        [-Sort]
        [-Since]
        [-Before]

Get group and paginated contacts belonging to it

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"

$GroupId = "GroupId_example" # String | 
$Page = 987 # Int32 | Optional page  in group contact pagination (optional) (default to 0)
$Size = 987 # Int32 | Optional page size in group contact 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)

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

Parameters

Name Type Description Notes
GroupId String
Page Int32 Optional page in group contact pagination [optional] [default to 0]
Size Int32 Optional page size in group contact 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

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

GroupProjection[] Get-Groups

Get all groups

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

GroupProjection[] (PSCustomObject)

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

GroupContactsDto Remove-ContactsFromGroup
        [-GroupId]
        [-UpdateGroupContacts]

Remove contacts from a group

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"

$GroupId = "GroupId_example" # String | 
$UpdateGroupContacts = (Initialize-UpdateGroupContacts -ContactIds @("ContactIds_example")) # UpdateGroupContacts | 

# Remove contacts from a group
try {
     $Result = Remove-ContactsFromGroup -GroupId $GroupId -UpdateGroupContacts $UpdateGroupContacts
} catch {
    Write-Host ("Exception occured when calling Remove-ContactsFromGroup: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

Name Type Description Notes
GroupId String
UpdateGroupContacts UpdateGroupContacts

Return type

GroupContactsDto (PSCustomObject)

Authorization

API_KEY

HTTP request headers

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

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