MailSlurpClient::GroupControllerApi

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

MethodHTTP requestDescription
add_contacts_to_groupPUT /groups/{groupId}/contactsAdd contacts to a group
create_groupPOST /groupsCreate a group
delete_groupDELETE /groups/{groupId}Delete group
get_all_groupsGET /groups/paginatedGet all Contact Groups in paginated format
get_groupGET /groups/{groupId}Get group
get_group_with_contactsGET /groups/{groupId}/contactsGet group and contacts belonging to it
get_group_with_contacts_paginatedGET /groups/{groupId}/contacts-paginatedGet group and paginated contacts belonging to it
get_groupsGET /groupsGet all groups
remove_contacts_from_groupDELETE /groups/{groupId}/contactsRemove 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

# 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 | groupId
update_group_contacts_option = MailSlurpClient::UpdateGroupContacts.new # UpdateGroupContacts | updateGroupContactsOption

begin
  #Add contacts to a group
  result = api_instance.add_contacts_to_group(group_id, update_group_contacts_option)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling GroupControllerApi->add_contacts_to_group: #{e}"
end

Parameters

NameTypeDescriptionNotes
group_idStringgroupId
update_group_contacts_optionUpdateGroupContactsupdateGroupContactsOption

Return type

GroupContactsDto

Authorization

API_KEY

HTTP request headers

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

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

NameTypeDescriptionNotes
create_group_optionsCreateGroupOptionscreateGroupOptions

Return type

GroupDto

Authorization

API_KEY

HTTP request headers

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

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

begin
  #Delete group
  api_instance.delete_group(group_id)
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling GroupControllerApi->delete_group: #{e}"
end

Parameters

NameTypeDescriptionNotes
group_idStringgroupId

Return type

nil (empty response body)

Authorization

API_KEY

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
}

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

NameTypeDescriptionNotes
pageIntegerOptional page in list pagination[optional] [default to 0]
sizeIntegerOptional page size in list pagination[optional] [default to 20]
sortStringOptional createdAt sort direction ASC or DESC[optional] [default to ‘ASC’]

Return type

PageGroupProjection

Authorization

API_KEY

HTTP request headers

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

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

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

NameTypeDescriptionNotes
group_idStringgroupId

Return type

GroupDto

Authorization

API_KEY

HTTP request headers

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

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

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

NameTypeDescriptionNotes
group_idStringgroupId

Return type

GroupContactsDto

Authorization

API_KEY

HTTP request headers

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

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

begin
  #Get group and paginated contacts belonging to it
  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

NameTypeDescriptionNotes
group_idStringgroupId
pageIntegerOptional page in group contact pagination[optional] [default to 0]
sizeIntegerOptional page size in group contact pagination[optional] [default to 20]
sortStringOptional createdAt sort direction ASC or DESC[optional] [default to ‘ASC’]

Return type

PageContactProjection

Authorization

API_KEY

HTTP request headers

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

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

Array

Authorization

API_KEY

HTTP request headers

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

remove_contacts_from_group

GroupContactsDto remove_contacts_from_group(group_id, update_group_contacts_option)

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 | groupId
update_group_contacts_option = MailSlurpClient::UpdateGroupContacts.new # UpdateGroupContacts | updateGroupContactsOption

begin
  #Remove contacts from a group
  result = api_instance.remove_contacts_from_group(group_id, update_group_contacts_option)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling GroupControllerApi->remove_contacts_from_group: #{e}"
end

Parameters

NameTypeDescriptionNotes
group_idStringgroupId
update_group_contacts_optionUpdateGroupContactsupdateGroupContactsOption

Return type

GroupContactsDto

Authorization

API_KEY

HTTP request headers

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