Skip to content

MailSlurp::GroupControllerApi

Load the API package

use MailSlurp::Object::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

GroupContactsDto add_contacts_to_group(group_id => $group_id, update_group_contacts => $update_group_contacts)

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 | 
my $update_group_contacts = MailSlurp::Object::UpdateGroupContacts->new(); # UpdateGroupContacts | 

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

Parameters

Name Type Description Notes
group_id string
update_group_contacts UpdateGroupContacts

Return type

GroupContactsDto

Authorization

API_KEY

HTTP request headers

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

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

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 | 

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

Name Type Description Notes
create_group_options CreateGroupOptions

Return type

GroupDto

Authorization

API_KEY

HTTP request headers

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

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

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 | 

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

Parameters

Name Type Description Notes
group_id string

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 ]

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

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

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

Parameters

Name Type Description Notes
page int Optional page in list pagination [optional] [default to 0]
size int 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

PageGroupProjection

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

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 | 

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

Parameters

Name Type Description Notes
group_id string

Return type

GroupDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

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 | 

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

Name Type Description Notes
group_id string

Return type

GroupContactsDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

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

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

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

Parameters

Name Type Description Notes
group_id string
page int Optional page in group contact pagination [optional] [default to 0]
size int 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

PageContactProjection

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

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

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

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

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 | 
my $update_group_contacts = MailSlurp::Object::UpdateGroupContacts->new(); # UpdateGroupContacts | 

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

Parameters

Name Type Description Notes
group_id string
update_group_contacts UpdateGroupContacts

Return type

GroupContactsDto

Authorization

API_KEY

HTTP request headers

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

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