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

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

MethodHTTP requestDescription
Add-ContactsToGroupPUT /groups/{groupId}/contactsAdd contacts to a group
New-GroupPOST /groupsCreate a group
Invoke-DeleteGroupDELETE /groups/{groupId}Delete group
Get-AllGroupsGET /groups/paginatedGet all Contact Groups in paginated format
Get-GroupGET /groups/{groupId}Get group
Get-GroupWithContactsGET /groups/{groupId}/contactsGet group and contacts belonging to it
Get-GroupWithContactsPaginatedGET /groups/{groupId}/contacts-paginatedGet group and paginated contacts belonging to it
Get-GroupsGET /groupsGet all groups
Remove-ContactsFromGroupDELETE /groups/{groupId}/contactsRemove contacts from a group

Add-ContactsToGroup

GroupContactsDto Add-ContactsToGroup         [-GroupId]         [-UpdateGroupContactsOption]

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 | groupId
$UpdateGroupContactsOption = (Initialize-UpdateGroupContacts -ContactIds @("ContactIds_example")) # UpdateGroupContacts | updateGroupContactsOption

# Add contacts to a group
try {
     $Result = Add-ContactsToGroup -GroupId $GroupId -UpdateGroupContactsOption $UpdateGroupContactsOption
} 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

NameTypeDescriptionNotes
GroupIdStringgroupId
UpdateGroupContactsOptionUpdateGroupContactsupdateGroupContactsOption

Return type

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

New-Group

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

NameTypeDescriptionNotes
CreateGroupOptionsCreateGroupOptionscreateGroupOptions

Return type

GroupDto (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-DeleteGroup

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

# 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

NameTypeDescriptionNotes
GroupIdStringgroupId

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

PageGroupProjection Get-AllGroups         [-Page] <System.Nullable[Int32]>         [-Size] <System.Nullable[Int32]>         [-Sort]

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 inbox list pagination (optional) (default to 0)
$Size = 987 # Int32 | Optional page size in inbox list pagination (optional) (default to 20)
$Sort = "ASC" # String | Optional createdAt sort direction ASC or DESC (optional) (default to "ASC")

# Get all Contact Groups in paginated format
try {
     $Result = Get-AllGroups -Page $Page -Size $Size -Sort $Sort
} 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

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

Return type

PageGroupProjection (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-Group

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

# 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

NameTypeDescriptionNotes
GroupIdStringgroupId

Return type

GroupDto (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-GroupWithContacts

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

# 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

NameTypeDescriptionNotes
GroupIdStringgroupId

Return type

GroupContactsDto (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-GroupWithContactsPaginated

PageContactProjection Get-GroupWithContactsPaginated         [-GroupId]         [-Page] <System.Nullable[Int32]>         [-Size] <System.Nullable[Int32]>         [-Sort]

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 | groupId
$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")

# Get group and paginated contacts belonging to it
try {
     $Result = Get-GroupWithContactsPaginated -GroupId $GroupId -Page $Page -Size $Size -Sort $Sort
} 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

NameTypeDescriptionNotes
GroupIdStringgroupId
PageInt32Optional page in group contact pagination[optional] [default to 0]
SizeInt32Optional page size in group contact 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-Groups

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: application/json

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

Remove-ContactsFromGroup

GroupContactsDto Remove-ContactsFromGroup         [-GroupId]         [-UpdateGroupContactsOption]

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 | groupId
$UpdateGroupContactsOption = (Initialize-UpdateGroupContacts -ContactIds @("ContactIds_example")) # UpdateGroupContacts | updateGroupContactsOption

# Remove contacts from a group
try {
     $Result = Remove-ContactsFromGroup -GroupId $GroupId -UpdateGroupContactsOption $UpdateGroupContactsOption
} 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

NameTypeDescriptionNotes
GroupIdStringgroupId
UpdateGroupContactsOptionUpdateGroupContactsupdateGroupContactsOption

Return type

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