mailslurp.api.AliasControllerApi

Load the API package

import 'package:mailslurp/api.dart';

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

AliasDto createAlias(createAliasOptions)

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

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';

final api_instance = AliasControllerApi();
final createAliasOptions = CreateAliasOptions(); // CreateAliasOptions | createAliasOptions

try { 
    final result = api_instance.createAlias(createAliasOptions);
    print(result);
} catch (e) {
    print('Exception when calling AliasControllerApi->createAlias: $en');
}

Parameters

NameTypeDescriptionNotes
createAliasOptionsCreateAliasOptionscreateAliasOptions

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 ]

deleteAlias

deleteAlias(aliasId)

Delete an email alias

Example

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';

final api_instance = AliasControllerApi();
final aliasId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | aliasId

try { 
    api_instance.deleteAlias(aliasId);
} catch (e) {
    print('Exception when calling AliasControllerApi->deleteAlias: $en');
}

Parameters

NameTypeDescriptionNotes
aliasIdStringaliasId

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

AliasDto getAlias(aliasId)

Get an email alias

Get an email alias by ID

Example

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';

final api_instance = AliasControllerApi();
final aliasId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | aliasId

try { 
    final result = api_instance.getAlias(aliasId);
    print(result);
} catch (e) {
    print('Exception when calling AliasControllerApi->getAlias: $en');
}

Parameters

NameTypeDescriptionNotes
aliasIdStringaliasId

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 ]

getAliasEmails

PageEmailProjection getAliasEmails(aliasId, before, page, since, size, sort)

Get emails for an alias

Get paginated emails for an alias by ID

Example

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';

final api_instance = AliasControllerApi();
final aliasId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | aliasId
final before = 2013-10-20T19:20:30+01:00; // DateTime | Optional filter by sent before given date time
final page = 56; // int | Optional page  alias email list pagination
final since = 2013-10-20T19:20:30+01:00; // DateTime | Optional filter by sent after given date time
final size = 56; // int | Optional page size alias email list pagination
final sort = sort_example; // String | Optional createdAt sort direction ASC or DESC

try { 
    final result = api_instance.getAliasEmails(aliasId, before, page, since, size, sort);
    print(result);
} catch (e) {
    print('Exception when calling AliasControllerApi->getAliasEmails: $en');
}

Parameters

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

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 ]

getAliasThreads

PageThreadProjection getAliasThreads(aliasId, before, page, since, size, sort)

Get threads created for an alias

Returns threads created for an email alias in paginated form

Example

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';

final api_instance = AliasControllerApi();
final aliasId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | aliasId
final before = 2013-10-20T19:20:30+01:00; // DateTime | Optional filter by sent before given date time
final page = 56; // int | Optional page  in thread list pagination
final since = 2013-10-20T19:20:30+01:00; // DateTime | Optional filter by sent after given date time
final size = 56; // int | Optional page size in thread list pagination
final sort = sort_example; // String | Optional createdAt sort direction ASC or DESC

try { 
    final result = api_instance.getAliasThreads(aliasId, before, page, since, size, sort);
    print(result);
} catch (e) {
    print('Exception when calling AliasControllerApi->getAliasThreads: $en');
}

Parameters

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

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 ]

getAliases

PageAlias getAliases(before, page, since, size, sort)

Get all email aliases you have created

Get all email aliases in paginated form

Example

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';

final api_instance = AliasControllerApi();
final before = 2013-10-20T19:20:30+01:00; // DateTime | Filter by created at before the given timestamp
final page = 56; // int | Optional page  in alias list pagination
final since = 2013-10-20T19:20:30+01:00; // DateTime | Filter by created at after the given timestamp
final size = 56; // int | Optional page size in alias list pagination
final sort = sort_example; // String | Optional createdAt sort direction ASC or DESC

try { 
    final result = api_instance.getAliases(before, page, since, size, sort);
    print(result);
} catch (e) {
    print('Exception when calling AliasControllerApi->getAliases: $en');
}

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

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 ]

replyToAliasEmail

SentEmailDto replyToAliasEmail(aliasId, emailId, replyToAliasEmailOptions)

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

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';

final api_instance = AliasControllerApi();
final aliasId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | ID of the alias that email belongs to
final emailId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | ID of the email that should be replied to
final replyToAliasEmailOptions = ReplyToAliasEmailOptions(); // ReplyToAliasEmailOptions | replyToAliasEmailOptions

try { 
    final result = api_instance.replyToAliasEmail(aliasId, emailId, replyToAliasEmailOptions);
    print(result);
} catch (e) {
    print('Exception when calling AliasControllerApi->replyToAliasEmail: $en');
}

Parameters

NameTypeDescriptionNotes
aliasIdStringID of the alias that email belongs to
emailIdStringID of the email that should be replied to
replyToAliasEmailOptionsReplyToAliasEmailOptionsreplyToAliasEmailOptions

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 ]

sendAliasEmail

SentEmailDto sendAliasEmail(aliasId, sendEmailOptions)

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

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';

final api_instance = AliasControllerApi();
final aliasId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | aliasId
final sendEmailOptions = SendEmailOptions(); // SendEmailOptions | Options for the email to be sent

try { 
    final result = api_instance.sendAliasEmail(aliasId, sendEmailOptions);
    print(result);
} catch (e) {
    print('Exception when calling AliasControllerApi->sendAliasEmail: $en');
}

Parameters

NameTypeDescriptionNotes
aliasIdStringaliasId
sendEmailOptionsSendEmailOptionsOptions 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 ]

updateAlias

updateAlias(aliasId, updateAliasOptions)

Update an email alias

Example

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';

final api_instance = AliasControllerApi();
final aliasId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | aliasId
final updateAliasOptions = UpdateAliasOptions(); // UpdateAliasOptions | updateAliasOptions

try { 
    api_instance.updateAlias(aliasId, updateAliasOptions);
} catch (e) {
    print('Exception when calling AliasControllerApi->updateAlias: $en');
}

Parameters

NameTypeDescriptionNotes
aliasIdStringaliasId
updateAliasOptionsUpdateAliasOptionsupdateAliasOptions

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 ]