MailSlurp::GroupControllerApi

Load the API package

use MailSlurp::Object::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 => $group_id, update_group_contacts_option => $update_group_contacts_option)

Add contacts to a group

Example

use Data::Dumper;
use MailSlurp::GroupControllerApi;
my $api_instance = MailSlurp::GroupControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $group_id = null; # string | groupId
my $update_group_contacts_option = MailSlurp::Object::UpdateGroupContacts->new(); # UpdateGroupContacts | updateGroupContactsOption

eval { 
    my $result = $api_instance->add_contacts_to_group(group_id => $group_id, update_group_contacts_option => $update_group_contacts_option);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling GroupControllerApi->add_contacts_to_group: $@n";
}

Parameters

NameTypeDescriptionNotes
group_idstringgroupId
update_group_contacts_optionUpdateGroupContactsupdateGroupContactsOption

Return type

GroupContactsDto

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 ]

create_group

GroupDto create_group(create_group_options => $create_group_options)

Create a group

Example

use Data::Dumper;
use MailSlurp::GroupControllerApi;
my $api_instance = MailSlurp::GroupControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $create_group_options = MailSlurp::Object::CreateGroupOptions->new(); # CreateGroupOptions | createGroupOptions

eval { 
    my $result = $api_instance->create_group(create_group_options => $create_group_options);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling GroupControllerApi->create_group: $@n";
}

Parameters

NameTypeDescriptionNotes
create_group_optionsCreateGroupOptionscreateGroupOptions

Return type

GroupDto

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 ]

delete_group

delete_group(group_id => $group_id)

Delete group

Example

use Data::Dumper;
use MailSlurp::GroupControllerApi;
my $api_instance = MailSlurp::GroupControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $group_id = null; # string | groupId

eval { 
    $api_instance->delete_group(group_id => $group_id);
};
if ($@) {
    warn "Exception when calling GroupControllerApi->delete_group: $@n";
}

Parameters

NameTypeDescriptionNotes
group_idstringgroupId

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_all_groups

PageGroupProjection get_all_groups(before => $before, page => $page, since => $since, size => $size, sort => $sort)

Get all Contact Groups in paginated format

Example

use Data::Dumper;
use MailSlurp::GroupControllerApi;
my $api_instance = MailSlurp::GroupControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $before = DateTime->from_epoch(epoch => str2time('null')); # DateTime | Filter by created at before the given timestamp
my $page = 0; # int | Optional page  in list pagination
my $since = DateTime->from_epoch(epoch => str2time('null')); # DateTime | Filter by created at after the given timestamp
my $size = 20; # int | Optional page size in list pagination
my $sort = 'ASC'; # string | Optional createdAt sort direction ASC or DESC

eval { 
    my $result = $api_instance->get_all_groups(before => $before, page => $page, since => $since, size => $size, sort => $sort);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling GroupControllerApi->get_all_groups: $@n";
}

Parameters

NameTypeDescriptionNotes
beforeDateTimeFilter by created at before the given timestamp[optional]
pageintOptional page in list pagination[optional] [default to 0]
sinceDateTimeFilter by created at after the given timestamp[optional]
sizeintOptional 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

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

get_group

GroupDto get_group(group_id => $group_id)

Get group

Example

use Data::Dumper;
use MailSlurp::GroupControllerApi;
my $api_instance = MailSlurp::GroupControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $group_id = null; # string | groupId

eval { 
    my $result = $api_instance->get_group(group_id => $group_id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling GroupControllerApi->get_group: $@n";
}

Parameters

NameTypeDescriptionNotes
group_idstringgroupId

Return type

GroupDto

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_with_contacts

GroupContactsDto get_group_with_contacts(group_id => $group_id)

Get group and contacts belonging to it

Example

use Data::Dumper;
use MailSlurp::GroupControllerApi;
my $api_instance = MailSlurp::GroupControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $group_id = null; # string | groupId

eval { 
    my $result = $api_instance->get_group_with_contacts(group_id => $group_id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling GroupControllerApi->get_group_with_contacts: $@n";
}

Parameters

NameTypeDescriptionNotes
group_idstringgroupId

Return type

GroupContactsDto

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_with_contacts_paginated

PageContactProjection get_group_with_contacts_paginated(group_id => $group_id, before => $before, page => $page, since => $since, size => $size, sort => $sort)

Get group and paginated contacts belonging to it

Example

use Data::Dumper;
use MailSlurp::GroupControllerApi;
my $api_instance = MailSlurp::GroupControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $group_id = null; # string | groupId
my $before = DateTime->from_epoch(epoch => str2time('null')); # DateTime | Filter by created at before the given timestamp
my $page = 0; # int | Optional page  in group contact pagination
my $since = DateTime->from_epoch(epoch => str2time('null')); # DateTime | Filter by created at after the given timestamp
my $size = 20; # int | Optional page size in group contact pagination
my $sort = 'ASC'; # string | Optional createdAt sort direction ASC or DESC

eval { 
    my $result = $api_instance->get_group_with_contacts_paginated(group_id => $group_id, before => $before, page => $page, since => $since, size => $size, sort => $sort);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling GroupControllerApi->get_group_with_contacts_paginated: $@n";
}

Parameters

NameTypeDescriptionNotes
group_idstringgroupId
beforeDateTimeFilter by created at before the given timestamp[optional]
pageintOptional page in group contact pagination[optional] [default to 0]
sinceDateTimeFilter by created at after the given timestamp[optional]
sizeintOptional 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

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

get_groups

ARRAY[GroupProjection] get_groups()

Get all groups

Example

use Data::Dumper;
use MailSlurp::GroupControllerApi;
my $api_instance = MailSlurp::GroupControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);


eval { 
    my $result = $api_instance->get_groups();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling GroupControllerApi->get_groups: $@n";
}

Parameters

This endpoint does not need any parameter.

Return type

**ARRAY[GroupProjection]**

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_contacts_from_group

GroupContactsDto remove_contacts_from_group(group_id => $group_id, update_group_contacts_option => $update_group_contacts_option)

Remove contacts from a group

Example

use Data::Dumper;
use MailSlurp::GroupControllerApi;
my $api_instance = MailSlurp::GroupControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $group_id = null; # string | groupId
my $update_group_contacts_option = MailSlurp::Object::UpdateGroupContacts->new(); # UpdateGroupContacts | updateGroupContactsOption

eval { 
    my $result = $api_instance->remove_contacts_from_group(group_id => $group_id, update_group_contacts_option => $update_group_contacts_option);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling GroupControllerApi->remove_contacts_from_group: $@n";
}

Parameters

NameTypeDescriptionNotes
group_idstringgroupId
update_group_contacts_optionUpdateGroupContactsupdateGroupContactsOption

Return type

GroupContactsDto

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 ]