MailSlurpAliasControllerApi

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

MethodHTTP requestDescription
createAliasPOST /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.
deleteAliasDELETE /aliases/{aliasId}Delete an email alias
getAliasGET /aliases/{aliasId}Get an email alias
getAliasEmailsGET /aliases/{aliasId}/emailsGet emails for an alias
getAliasThreadsGET /aliases/{aliasId}/threadsGet threads created for an alias
getAliasesGET /aliasesGet all email aliases you have created
replyToAliasEmailPUT /aliases/{aliasId}/emails/{emailId}Reply to an email
sendAliasEmailPOST /aliases/{aliasId}/emailsSend an email from an alias inbox
updateAliasPUT /aliases/{aliasId}Update an email alias

createAlias

MailSlurpModelsAliasDto createAlias($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

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiAliasControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$create_alias_options = new MailSlurpModelsCreateAliasOptions(); // MailSlurpModelsCreateAliasOptions | createAliasOptions

try {
    $result = $apiInstance->createAlias($create_alias_options);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AliasControllerApi->createAlias: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

NameTypeDescriptionNotes
create_alias_optionsMailSlurpModelsCreateAliasOptionscreateAliasOptions

Return type

MailSlurpModelsAliasDto

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 ]

deleteAlias

deleteAlias($alias_id)

Delete an email alias

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiAliasControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$alias_id = 'alias_id_example'; // string | aliasId

try {
    $apiInstance->deleteAlias($alias_id);
} catch (Exception $e) {
    echo 'Exception when calling AliasControllerApi->deleteAlias: ', $e->getMessage(), PHP_EOL;
}
?>

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 ]

getAlias

MailSlurpModelsAliasDto getAlias($alias_id)

Get an email alias

Get an email alias by ID

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiAliasControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$alias_id = 'alias_id_example'; // string | aliasId

try {
    $result = $apiInstance->getAlias($alias_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AliasControllerApi->getAlias: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

NameTypeDescriptionNotes
alias_idstringaliasId

Return type

MailSlurpModelsAliasDto

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 ]

getAliasEmails

MailSlurpModelsPageEmailProjection getAliasEmails($alias_id, $before, $page, $since, $size, $sort)

Get emails for an alias

Get paginated emails for an alias by ID

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiAliasControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$alias_id = 'alias_id_example'; // string | aliasId
$before = new DateTime("2013-10-20T19:20:30+01:00"); // DateTime | Optional filter by sent before given date time
$page = 0; // int | Optional page  alias email list pagination
$since = new DateTime("2013-10-20T19:20:30+01:00"); // DateTime | Optional filter by sent after given date time
$size = 20; // int | Optional page size alias email list pagination
$sort = 'ASC'; // string | Optional createdAt sort direction ASC or DESC

try {
    $result = $apiInstance->getAliasEmails($alias_id, $before, $page, $since, $size, $sort);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AliasControllerApi->getAliasEmails: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

NameTypeDescriptionNotes
alias_idstringaliasId
beforeDateTimeOptional filter by sent before given date time[optional]
pageintOptional page alias email list pagination[optional] [default to 0]
sinceDateTimeOptional filter by sent after given date time[optional]
sizeintOptional page size alias email list pagination[optional] [default to 20]
sortstringOptional createdAt sort direction ASC or DESC[optional] [default to ‘ASC’]

Return type

MailSlurpModelsPageEmailProjection

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 ]

getAliasThreads

MailSlurpModelsPageThreadProjection getAliasThreads($alias_id, $before, $page, $since, $size, $sort)

Get threads created for an alias

Returns threads created for an email alias in paginated form

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiAliasControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$alias_id = 'alias_id_example'; // string | aliasId
$before = new DateTime("2013-10-20T19:20:30+01:00"); // DateTime | Optional filter by sent before given date time
$page = 0; // int | Optional page  in thread list pagination
$since = new DateTime("2013-10-20T19:20:30+01:00"); // DateTime | Optional filter by sent after given date time
$size = 20; // int | Optional page size in thread list pagination
$sort = 'ASC'; // string | Optional createdAt sort direction ASC or DESC

try {
    $result = $apiInstance->getAliasThreads($alias_id, $before, $page, $since, $size, $sort);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AliasControllerApi->getAliasThreads: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

NameTypeDescriptionNotes
alias_idstringaliasId
beforeDateTimeOptional filter by sent before given date time[optional]
pageintOptional page in thread list pagination[optional] [default to 0]
sinceDateTimeOptional filter by sent after given date time[optional]
sizeintOptional page size in thread list pagination[optional] [default to 20]
sortstringOptional createdAt sort direction ASC or DESC[optional] [default to ‘ASC’]

Return type

MailSlurpModelsPageThreadProjection

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 ]

getAliases

MailSlurpModelsPageAlias getAliases($before, $page, $since, $size, $sort)

Get all email aliases you have created

Get all email aliases in paginated form

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiAliasControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$before = new DateTime("2013-10-20T19:20:30+01:00"); // DateTime | Filter by created at before the given timestamp
$page = 0; // int | Optional page  in alias list pagination
$since = new DateTime("2013-10-20T19:20:30+01:00"); // DateTime | Filter by created at after the given timestamp
$size = 20; // int | Optional page size in alias list pagination
$sort = 'ASC'; // string | Optional createdAt sort direction ASC or DESC

try {
    $result = $apiInstance->getAliases($before, $page, $since, $size, $sort);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AliasControllerApi->getAliases: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

NameTypeDescriptionNotes
beforeDateTimeFilter by created at before the given timestamp[optional]
pageintOptional page in alias list pagination[optional] [default to 0]
sinceDateTimeFilter by created at after the given timestamp[optional]
sizeintOptional page size in alias list pagination[optional] [default to 20]
sortstringOptional createdAt sort direction ASC or DESC[optional] [default to ‘ASC’]

Return type

MailSlurpModelsPageAlias

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 ]

replyToAliasEmail

MailSlurpModelsSentEmailDto replyToAliasEmail($alias_id, $email_id, $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

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiAliasControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$alias_id = 'alias_id_example'; // string | ID of the alias that email belongs to
$email_id = 'email_id_example'; // string | ID of the email that should be replied to
$reply_to_alias_email_options = new MailSlurpModelsReplyToAliasEmailOptions(); // MailSlurpModelsReplyToAliasEmailOptions | replyToAliasEmailOptions

try {
    $result = $apiInstance->replyToAliasEmail($alias_id, $email_id, $reply_to_alias_email_options);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AliasControllerApi->replyToAliasEmail: ', $e->getMessage(), PHP_EOL;
}
?>

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_optionsMailSlurpModelsReplyToAliasEmailOptionsreplyToAliasEmailOptions

Return type

MailSlurpModelsSentEmailDto

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 ]

sendAliasEmail

MailSlurpModelsSentEmailDto sendAliasEmail($alias_id, $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

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiAliasControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$alias_id = 'alias_id_example'; // string | aliasId
$send_email_options = new MailSlurpModelsSendEmailOptions(); // MailSlurpModelsSendEmailOptions | Options for the email to be sent

try {
    $result = $apiInstance->sendAliasEmail($alias_id, $send_email_options);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AliasControllerApi->sendAliasEmail: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

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

Return type

MailSlurpModelsSentEmailDto

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 ]

updateAlias

updateAlias($alias_id, $update_alias_options)

Update an email alias

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiAliasControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$alias_id = 'alias_id_example'; // string | aliasId
$update_alias_options = new MailSlurpModelsUpdateAliasOptions(); // MailSlurpModelsUpdateAliasOptions | updateAliasOptions

try {
    $apiInstance->updateAlias($alias_id, $update_alias_options);
} catch (Exception $e) {
    echo 'Exception when calling AliasControllerApi->updateAlias: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

NameTypeDescriptionNotes
alias_idstringaliasId
update_alias_optionsMailSlurpModelsUpdateAliasOptionsupdateAliasOptions

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 ]