MailSlurpClient::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_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)
Add contacts to a group
Example
# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
# Configure API key authorization: API_KEY
config.api_key['x-api-key'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['x-api-key'] = 'Bearer'
end
api_instance = MailSlurpClient::GroupControllerApi.new
group_id = 'group_id_example' # String |
update_group_contacts = MailSlurpClient::UpdateGroupContacts.new # UpdateGroupContacts |
begin
#Add contacts to a group
result = api_instance.add_contacts_to_group(group_id, update_group_contacts)
p result
rescue MailSlurpClient::ApiError => e
puts "Exception when calling GroupControllerApi->add_contacts_to_group: #{e}"
end
Parameters
Name | Type | Description | Notes |
---|---|---|---|
group_id | String | ||
update_group_contacts | UpdateGroupContacts |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: /
create_group
GroupDto create_group(create_group_options)
Create a group
Example
# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
# Configure API key authorization: API_KEY
config.api_key['x-api-key'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['x-api-key'] = 'Bearer'
end
api_instance = MailSlurpClient::GroupControllerApi.new
create_group_options = MailSlurpClient::CreateGroupOptions.new # CreateGroupOptions |
begin
#Create a group
result = api_instance.create_group(create_group_options)
p result
rescue MailSlurpClient::ApiError => e
puts "Exception when calling GroupControllerApi->create_group: #{e}"
end
Parameters
Name | Type | Description | Notes |
---|---|---|---|
create_group_options | CreateGroupOptions |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: /
delete_group
delete_group(group_id)
Delete group
Example
# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
# Configure API key authorization: API_KEY
config.api_key['x-api-key'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['x-api-key'] = 'Bearer'
end
api_instance = MailSlurpClient::GroupControllerApi.new
group_id = 'group_id_example' # String |
begin
#Delete group
api_instance.delete_group(group_id)
rescue MailSlurpClient::ApiError => e
puts "Exception when calling GroupControllerApi->delete_group: #{e}"
end
Parameters
Name | Type | Description | Notes |
---|---|---|---|
group_id | String |
Return type
nil (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
get_all_groups
PageGroupProjection get_all_groups(opts)
Get all Contact Groups in paginated format
Example
# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
# Configure API key authorization: API_KEY
config.api_key['x-api-key'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['x-api-key'] = 'Bearer'
end
api_instance = MailSlurpClient::GroupControllerApi.new
opts = {
page: 0, # Integer | Optional page in list pagination
size: 20, # Integer | Optional page size in list pagination
sort: 'ASC', # String | Optional createdAt sort direction ASC or DESC
since: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Filter by created at after the given timestamp
before: DateTime.parse('2013-10-20T19:20:30+01:00') # DateTime | Filter by created at before the given timestamp
}
begin
#Get all Contact Groups in paginated format
result = api_instance.get_all_groups(opts)
p result
rescue MailSlurpClient::ApiError => e
puts "Exception when calling GroupControllerApi->get_all_groups: #{e}"
end
Parameters
Name | Type | Description | Notes |
---|---|---|---|
page | Integer | Optional page in list pagination | [optional] [default to 0] |
size | Integer | Optional page size in list pagination | [optional] [default to 20] |
sort | String | Optional createdAt sort direction ASC or DESC | [optional] [default to 'ASC'] |
since | DateTime | Filter by created at after the given timestamp | [optional] |
before | DateTime | Filter by created at before the given timestamp | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
get_group
GroupDto get_group(group_id)
Get group
Example
# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
# Configure API key authorization: API_KEY
config.api_key['x-api-key'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['x-api-key'] = 'Bearer'
end
api_instance = MailSlurpClient::GroupControllerApi.new
group_id = 'group_id_example' # String |
begin
#Get group
result = api_instance.get_group(group_id)
p result
rescue MailSlurpClient::ApiError => e
puts "Exception when calling GroupControllerApi->get_group: #{e}"
end
Parameters
Name | Type | Description | Notes |
---|---|---|---|
group_id | String |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
get_group_with_contacts
GroupContactsDto get_group_with_contacts(group_id)
Get group and contacts belonging to it
Example
# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
# Configure API key authorization: API_KEY
config.api_key['x-api-key'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['x-api-key'] = 'Bearer'
end
api_instance = MailSlurpClient::GroupControllerApi.new
group_id = 'group_id_example' # String |
begin
#Get group and contacts belonging to it
result = api_instance.get_group_with_contacts(group_id)
p result
rescue MailSlurpClient::ApiError => e
puts "Exception when calling GroupControllerApi->get_group_with_contacts: #{e}"
end
Parameters
Name | Type | Description | Notes |
---|---|---|---|
group_id | String |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
get_group_with_contacts_paginated
PageContactProjection get_group_with_contacts_paginated(group_id, opts)
Get group and paginated contacts belonging to it
Example
# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
# Configure API key authorization: API_KEY
config.api_key['x-api-key'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['x-api-key'] = 'Bearer'
end
api_instance = MailSlurpClient::GroupControllerApi.new
group_id = 'group_id_example' # String |
opts = {
page: 0, # Integer | Optional page in group contact pagination
size: 20, # Integer | Optional page size in group contact pagination
sort: 'ASC', # String | Optional createdAt sort direction ASC or DESC
since: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Filter by created at after the given timestamp
before: DateTime.parse('2013-10-20T19:20:30+01:00') # DateTime | Filter by created at before the given timestamp
}
begin
result = api_instance.get_group_with_contacts_paginated(group_id, opts)
p result
rescue MailSlurpClient::ApiError => e
puts "Exception when calling GroupControllerApi->get_group_with_contacts_paginated: #{e}"
end
Parameters
Name | Type | Description | Notes |
---|---|---|---|
group_id | String | ||
page | Integer | Optional page in group contact pagination | [optional] [default to 0] |
size | Integer | 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 | DateTime | Filter by created at after the given timestamp | [optional] |
before | DateTime | Filter by created at before the given timestamp | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
get_groups
Array
get_groups
Get all groups
Example
# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
# Configure API key authorization: API_KEY
config.api_key['x-api-key'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['x-api-key'] = 'Bearer'
end
api_instance = MailSlurpClient::GroupControllerApi.new
begin
#Get all groups
result = api_instance.get_groups
p result
rescue MailSlurpClient::ApiError => e
puts "Exception when calling GroupControllerApi->get_groups: #{e}"
end
Parameters
This endpoint does not need any parameter.
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
remove_contacts_from_group
GroupContactsDto remove_contacts_from_group(group_id, update_group_contacts)
Remove contacts from a group
Example
# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
# Configure API key authorization: API_KEY
config.api_key['x-api-key'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['x-api-key'] = 'Bearer'
end
api_instance = MailSlurpClient::GroupControllerApi.new
group_id = 'group_id_example' # String |
update_group_contacts = MailSlurpClient::UpdateGroupContacts.new # UpdateGroupContacts |
begin
#Remove contacts from a group
result = api_instance.remove_contacts_from_group(group_id, update_group_contacts)
p result
rescue MailSlurpClient::ApiError => e
puts "Exception when calling GroupControllerApi->remove_contacts_from_group: #{e}"
end
Parameters
Name | Type | Description | Notes |
---|---|---|---|
group_id | String | ||
update_group_contacts | UpdateGroupContacts |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: /