# mailslurp_client.GroupControllerApi
All URIs are relative to https://api.mailslurp.com
Method | HTTP request | Description |
---|---|---|
add_contacts_to_group | PUT /groups/{groupId}/contacts | Add contacts to a group |
create_group | POST /groups | Create a group |
delete_group | DELETE /groups/{groupId} | Delete group |
get_all_groups | GET /groups/paginated | Get all Contact Groups in paginated format |
get_group | GET /groups/{groupId} | Get group |
get_group_with_contacts | GET /groups/{groupId}/contacts | Get group and contacts belonging to it |
get_group_with_contacts_paginated | GET /groups/{groupId}/contacts-paginated | Get group and paginated contacts belonging to it |
get_groups | GET /groups | Get all groups |
remove_contacts_from_group | DELETE /groups/{groupId}/contacts | Remove contacts from a group |
# add_contacts_to_group
GroupContactsDto add_contacts_to_group(group_id, update_group_contacts_option)
Add contacts to a group
# Example
- Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com",
api_key = {
'x-api-key': 'YOUR_API_KEY'
}
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mailslurp_client.GroupControllerApi(api_client)
group_id = 'group_id_example' # str | groupId
update_group_contacts_option = mailslurp_client.UpdateGroupContacts() # UpdateGroupContacts | updateGroupContactsOption
try:
# Add contacts to a group
api_response = api_instance.add_contacts_to_group(group_id, update_group_contacts_option)
pprint(api_response)
except ApiException as e:
print("Exception when calling GroupControllerApi->add_contacts_to_group: %s\n" % e)
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
group_id | str | groupId | |
update_group_contacts_option | UpdateGroupContacts | updateGroupContactsOption |
# Return type
# Authorization
# HTTP request headers
- Content-Type: application/json
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
201 | Created | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# create_group
GroupDto create_group(create_group_options)
Create a group
# Example
- Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com",
api_key = {
'x-api-key': 'YOUR_API_KEY'
}
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mailslurp_client.GroupControllerApi(api_client)
create_group_options = mailslurp_client.CreateGroupOptions() # CreateGroupOptions | createGroupOptions
try:
# Create a group
api_response = api_instance.create_group(create_group_options)
pprint(api_response)
except ApiException as e:
print("Exception when calling GroupControllerApi->create_group: %s\n" % e)
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
create_group_options | CreateGroupOptions | createGroupOptions |
# Return type
# Authorization
# HTTP request headers
- Content-Type: application/json
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
201 | Created | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# delete_group
delete_group(group_id)
Delete group
# Example
- Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com",
api_key = {
'x-api-key': 'YOUR_API_KEY'
}
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mailslurp_client.GroupControllerApi(api_client)
group_id = 'group_id_example' # str | groupId
try:
# Delete group
api_instance.delete_group(group_id)
except ApiException as e:
print("Exception when calling GroupControllerApi->delete_group: %s\n" % e)
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
group_id | str | groupId |
# Return type
void (empty response body)
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
# HTTP response details
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
401 | Unauthorized | - |
403 | Forbidden | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# get_all_groups
PageGroupProjection get_all_groups(page=page, size=size, sort=sort)
Get all Contact Groups in paginated format
# Example
- Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com",
api_key = {
'x-api-key': 'YOUR_API_KEY'
}
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mailslurp_client.GroupControllerApi(api_client)
page = 0 # int | Optional page index in inbox list pagination (optional) (default to 0)
size = 20 # int | Optional page size in inbox list pagination (optional) (default to 20)
sort = 'ASC' # str | Optional createdAt sort direction ASC or DESC (optional) (default to 'ASC')
try:
# Get all Contact Groups in paginated format
api_response = api_instance.get_all_groups(page=page, size=size, sort=sort)
pprint(api_response)
except ApiException as e:
print("Exception when calling GroupControllerApi->get_all_groups: %s\n" % e)
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
page | int | Optional page index in inbox list pagination | [optional] [default to 0] |
size | int | Optional page size in inbox list pagination | [optional] [default to 20] |
sort | str | Optional createdAt sort direction ASC or DESC | [optional] [default to 'ASC'] |
# Return type
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# get_group
GroupDto get_group(group_id)
Get group
# Example
- Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com",
api_key = {
'x-api-key': 'YOUR_API_KEY'
}
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mailslurp_client.GroupControllerApi(api_client)
group_id = 'group_id_example' # str | groupId
try:
# Get group
api_response = api_instance.get_group(group_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling GroupControllerApi->get_group: %s\n" % e)
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
group_id | str | groupId |
# Return type
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# get_group_with_contacts
GroupContactsDto get_group_with_contacts(group_id)
Get group and contacts belonging to it
# Example
- Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com",
api_key = {
'x-api-key': 'YOUR_API_KEY'
}
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mailslurp_client.GroupControllerApi(api_client)
group_id = 'group_id_example' # str | groupId
try:
# Get group and contacts belonging to it
api_response = api_instance.get_group_with_contacts(group_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling GroupControllerApi->get_group_with_contacts: %s\n" % e)
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
group_id | str | groupId |
# Return type
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# get_group_with_contacts_paginated
PageContactProjection get_group_with_contacts_paginated(group_id, page=page, size=size, sort=sort)
Get group and paginated contacts belonging to it
# Example
- Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com",
api_key = {
'x-api-key': 'YOUR_API_KEY'
}
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mailslurp_client.GroupControllerApi(api_client)
group_id = 'group_id_example' # str | groupId
page = 0 # int | Optional page index in group contact pagination (optional) (default to 0)
size = 20 # int | Optional page size in group contact pagination (optional) (default to 20)
sort = 'ASC' # str | Optional createdAt sort direction ASC or DESC (optional) (default to 'ASC')
try:
# Get group and paginated contacts belonging to it
api_response = api_instance.get_group_with_contacts_paginated(group_id, page=page, size=size, sort=sort)
pprint(api_response)
except ApiException as e:
print("Exception when calling GroupControllerApi->get_group_with_contacts_paginated: %s\n" % e)
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
group_id | str | groupId | |
page | int | Optional page index in group contact pagination | [optional] [default to 0] |
size | int | Optional page size in group contact pagination | [optional] [default to 20] |
sort | str | Optional createdAt sort direction ASC or DESC | [optional] [default to 'ASC'] |
# Return type
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# get_groups
list[GroupProjection] get_groups()
Get all groups
# Example
- Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com",
api_key = {
'x-api-key': 'YOUR_API_KEY'
}
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mailslurp_client.GroupControllerApi(api_client)
try:
# Get all groups
api_response = api_instance.get_groups()
pprint(api_response)
except ApiException as e:
print("Exception when calling GroupControllerApi->get_groups: %s\n" % e)
# Parameters
This endpoint does not need any parameter.
# Return type
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# remove_contacts_from_group
GroupContactsDto remove_contacts_from_group(group_id, update_group_contacts_option)
Remove contacts from a group
# Example
- Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com",
api_key = {
'x-api-key': 'YOUR_API_KEY'
}
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mailslurp_client.GroupControllerApi(api_client)
group_id = 'group_id_example' # str | groupId
update_group_contacts_option = mailslurp_client.UpdateGroupContacts() # UpdateGroupContacts | updateGroupContactsOption
try:
# Remove contacts from a group
api_response = api_instance.remove_contacts_from_group(group_id, update_group_contacts_option)
pprint(api_response)
except ApiException as e:
print("Exception when calling GroupControllerApi->remove_contacts_from_group: %s\n" % e)
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
group_id | str | groupId | |
update_group_contacts_option | UpdateGroupContacts | updateGroupContactsOption |
# Return type
# Authorization
# HTTP request headers
- Content-Type: application/json
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
204 | No Content | - |
401 | Unauthorized | - |
403 | Forbidden | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]