MailSlurp::AliasControllerApi

Load the API package

use MailSlurp::Object::AliasControllerApi;

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

MethodHTTP requestDescription
create_aliasPOST /aliasesCreate an email alias. Must be verified by clicking link inside verification email that will be sent to the address. Once verified the alias will be active.
delete_aliasDELETE /aliases/{aliasId}Delete an email alias
get_aliasGET /aliases/{aliasId}Get an email alias
get_alias_emailsGET /aliases/{aliasId}/emailsGet emails for an alias
get_alias_threadsGET /aliases/{aliasId}/threadsGet threads created for an alias
get_aliasesGET /aliasesGet all email aliases you have created
reply_to_alias_emailPUT /aliases/{aliasId}/emails/{emailId}Reply to an email
send_alias_emailPOST /aliases/{aliasId}/emailsSend an email from an alias inbox
update_aliasPUT /aliases/{aliasId}Update an email alias

create_alias

AliasDto create_alias(create_alias_options => $create_alias_options)

Create an email alias. Must be verified by clicking link inside verification email that will be sent to the address. Once verified the alias will be active.

Email aliases use a MailSlurp randomly generated email address (or a custom domain inbox that you provide) to mask or proxy a real email address. Emails sent to the alias address will be forwarded to the hidden email address it was created for. If you want to send a reply use the threadId attached

Example

use Data::Dumper;
use MailSlurp::AliasControllerApi;
my $api_instance = MailSlurp::AliasControllerApi->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_alias_options = MailSlurp::Object::CreateAliasOptions->new(); # CreateAliasOptions | createAliasOptions

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

Parameters

NameTypeDescriptionNotes
create_alias_optionsCreateAliasOptionscreateAliasOptions

Return type

AliasDto

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_alias

delete_alias(alias_id => $alias_id)

Delete an email alias

Example

use Data::Dumper;
use MailSlurp::AliasControllerApi;
my $api_instance = MailSlurp::AliasControllerApi->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 $alias_id = null; # string | aliasId

eval { 
    $api_instance->delete_alias(alias_id => $alias_id);
};
if ($@) {
    warn "Exception when calling AliasControllerApi->delete_alias: $@n";
}

Parameters

NameTypeDescriptionNotes
alias_idstringaliasId

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_alias

AliasDto get_alias(alias_id => $alias_id)

Get an email alias

Get an email alias by ID

Example

use Data::Dumper;
use MailSlurp::AliasControllerApi;
my $api_instance = MailSlurp::AliasControllerApi->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 $alias_id = null; # string | aliasId

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

Parameters

NameTypeDescriptionNotes
alias_idstringaliasId

Return type

AliasDto

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_alias_emails

PageEmailProjection get_alias_emails(alias_id => $alias_id, page => $page, size => $size, sort => $sort)

Get emails for an alias

Get paginated emails for an alias by ID

Example

use Data::Dumper;
use MailSlurp::AliasControllerApi;
my $api_instance = MailSlurp::AliasControllerApi->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 $alias_id = null; # string | aliasId
my $page = 0; # int | Optional page  alias email list pagination
my $size = 20; # int | Optional page size alias email list pagination
my $sort = 'ASC'; # string | Optional createdAt sort direction ASC or DESC

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

Parameters

NameTypeDescriptionNotes
alias_idstringaliasId
pageintOptional page alias email list pagination[optional] [default to 0]
sizeintOptional page size alias email list pagination[optional] [default to 20]
sortstringOptional createdAt sort direction ASC or DESC[optional] [default to ‘ASC’]

Return type

PageEmailProjection

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_alias_threads

PageThreadProjection get_alias_threads(alias_id => $alias_id, page => $page, size => $size, sort => $sort)

Get threads created for an alias

Returns threads created for an email alias in paginated form

Example

use Data::Dumper;
use MailSlurp::AliasControllerApi;
my $api_instance = MailSlurp::AliasControllerApi->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 $alias_id = null; # string | aliasId
my $page = 0; # int | Optional page  in thread list pagination
my $size = 20; # int | Optional page size in thread list pagination
my $sort = 'ASC'; # string | Optional createdAt sort direction ASC or DESC

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

Parameters

NameTypeDescriptionNotes
alias_idstringaliasId
pageintOptional page in thread list pagination[optional] [default to 0]
sizeintOptional page size in thread list pagination[optional] [default to 20]
sortstringOptional createdAt sort direction ASC or DESC[optional] [default to ‘ASC’]

Return type

PageThreadProjection

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_aliases

PageAlias get_aliases(page => $page, size => $size, sort => $sort)

Get all email aliases you have created

Get all email aliases in paginated form

Example

use Data::Dumper;
use MailSlurp::AliasControllerApi;
my $api_instance = MailSlurp::AliasControllerApi->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 alias list pagination
my $size = 20; # int | Optional page size in alias list pagination
my $sort = 'ASC'; # string | Optional createdAt sort direction ASC or DESC

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

Parameters

NameTypeDescriptionNotes
pageintOptional page in alias list pagination[optional] [default to 0]
sizeintOptional page size in alias list pagination[optional] [default to 20]
sortstringOptional createdAt sort direction ASC or DESC[optional] [default to ‘ASC’]

Return type

PageAlias

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 ]

reply_to_alias_email

SentEmailDto reply_to_alias_email(alias_id => $alias_id, email_id => $email_id, reply_to_alias_email_options => $reply_to_alias_email_options)

Reply to an email

Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails to, cc, and bcc.

Example

use Data::Dumper;
use MailSlurp::AliasControllerApi;
my $api_instance = MailSlurp::AliasControllerApi->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 $alias_id = null; # string | ID of the alias that email belongs to
my $email_id = null; # string | ID of the email that should be replied to
my $reply_to_alias_email_options = MailSlurp::Object::ReplyToAliasEmailOptions->new(); # ReplyToAliasEmailOptions | replyToAliasEmailOptions

eval { 
    my $result = $api_instance->reply_to_alias_email(alias_id => $alias_id, email_id => $email_id, reply_to_alias_email_options => $reply_to_alias_email_options);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AliasControllerApi->reply_to_alias_email: $@n";
}

Parameters

NameTypeDescriptionNotes
alias_idstringID of the alias that email belongs to
email_idstringID of the email that should be replied to
reply_to_alias_email_optionsReplyToAliasEmailOptionsreplyToAliasEmailOptions

Return type

SentEmailDto

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 ]

send_alias_email

SentEmailDto send_alias_email(alias_id => $alias_id, send_email_options => $send_email_options)

Send an email from an alias inbox

Send an email from an alias. Replies to the email will be forwarded to the alias masked email address

Example

use Data::Dumper;
use MailSlurp::AliasControllerApi;
my $api_instance = MailSlurp::AliasControllerApi->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 $alias_id = null; # string | aliasId
my $send_email_options = MailSlurp::Object::SendEmailOptions->new(); # SendEmailOptions | Options for the email to be sent

eval { 
    my $result = $api_instance->send_alias_email(alias_id => $alias_id, send_email_options => $send_email_options);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AliasControllerApi->send_alias_email: $@n";
}

Parameters

NameTypeDescriptionNotes
alias_idstringaliasId
send_email_optionsSendEmailOptionsOptions for the email to be sent[optional]

Return type

SentEmailDto

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 ]

update_alias

update_alias(alias_id => $alias_id, update_alias_options => $update_alias_options)

Update an email alias

Example

use Data::Dumper;
use MailSlurp::AliasControllerApi;
my $api_instance = MailSlurp::AliasControllerApi->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 $alias_id = null; # string | aliasId
my $update_alias_options = MailSlurp::Object::UpdateAliasOptions->new(); # UpdateAliasOptions | updateAliasOptions

eval { 
    $api_instance->update_alias(alias_id => $alias_id, update_alias_options => $update_alias_options);
};
if ($@) {
    warn "Exception when calling AliasControllerApi->update_alias: $@n";
}

Parameters

NameTypeDescriptionNotes
alias_idstringaliasId
update_alias_optionsUpdateAliasOptionsupdateAliasOptions

Return type

void (empty response body)

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 ]