# mailslurp.Api.AliasControllerApi
All URIs are relative to https://api.mailslurp.com
Method | HTTP request | Description |
---|---|---|
CreateAlias | POST /aliases | 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. |
DeleteAlias | DELETE /aliases/{aliasId} | Delete an email alias |
GetAlias | GET /aliases/{aliasId} | Get an email alias |
GetAliasEmails | GET /aliases/{aliasId}/emails | Get emails for an alias |
GetAliasThreads | GET /aliases/{aliasId}/threads | Get threads created for an alias |
GetAliases | GET /aliases | Get all email aliases you have created |
ReplyToAliasEmail | PUT /aliases/{aliasId}/emails/{emailId} | Reply to an email |
SendAliasEmail | POST /aliases/{aliasId}/emails | Send an email from an alias inbox |
UpdateAlias | PUT /aliases/{aliasId} | Update an email alias |
# CreateAlias
AliasDto CreateAlias (CreateAliasOptions 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
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
public class CreateAliasExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new AliasControllerApi(config);
var createAliasOptions = new CreateAliasOptions(); // CreateAliasOptions | createAliasOptions
try
{
// 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.
AliasDto result = apiInstance.CreateAlias(createAliasOptions);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AliasControllerApi.CreateAlias: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
createAliasOptions | CreateAliasOptions | createAliasOptions |
# Return type
# Authorization
# HTTP request headers
- Content-Type: application/json
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
201 | Created | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# DeleteAlias
void DeleteAlias (Guid aliasId)
Delete an email alias
# Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
public class DeleteAliasExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new AliasControllerApi(config);
var aliasId = new Guid(); // Guid | aliasId
try
{
// Delete an email alias
apiInstance.DeleteAlias(aliasId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AliasControllerApi.DeleteAlias: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
aliasId | Guid | aliasId |
# Return type
void (empty response body)
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
# HTTP response details
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
401 | Unauthorized | - |
403 | Forbidden | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# GetAlias
AliasDto GetAlias (Guid aliasId)
Get an email alias
Get an email alias by ID
# Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
public class GetAliasExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new AliasControllerApi(config);
var aliasId = new Guid(); // Guid | aliasId
try
{
// Get an email alias
AliasDto result = apiInstance.GetAlias(aliasId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AliasControllerApi.GetAlias: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
aliasId | Guid | aliasId |
# Return type
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# GetAliasEmails
PageEmailProjection GetAliasEmails (Guid aliasId, int? page = null, int? size = null, string sort = null)
Get emails for an alias
Get paginated emails for an alias by ID
# Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
public class GetAliasEmailsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new AliasControllerApi(config);
var aliasId = new Guid(); // Guid | aliasId
var page = 56; // int? | Optional page index alias email list pagination (optional) (default to 0)
var size = 56; // int? | Optional page size alias email list pagination (optional) (default to 20)
var sort = sort_example; // string | Optional createdAt sort direction ASC or DESC (optional) (default to ASC)
try
{
// Get emails for an alias
PageEmailProjection result = apiInstance.GetAliasEmails(aliasId, page, size, sort);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AliasControllerApi.GetAliasEmails: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
aliasId | Guid | aliasId | |
page | int? | Optional page index alias email list pagination | [optional] [default to 0] |
size | int? | Optional page size alias email list pagination | [optional] [default to 20] |
sort | string | Optional createdAt sort direction ASC or DESC | [optional] [default to ASC] |
# Return type
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# GetAliasThreads
PageThreadProjection GetAliasThreads (Guid aliasId, int? page = null, int? size = null, string sort = null)
Get threads created for an alias
Returns threads created for an email alias in paginated form
# Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
public class GetAliasThreadsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new AliasControllerApi(config);
var aliasId = new Guid(); // Guid | aliasId
var page = 56; // int? | Optional page index in thread list pagination (optional) (default to 0)
var size = 56; // int? | Optional page size in thread list pagination (optional) (default to 20)
var sort = sort_example; // string | Optional createdAt sort direction ASC or DESC (optional) (default to ASC)
try
{
// Get threads created for an alias
PageThreadProjection result = apiInstance.GetAliasThreads(aliasId, page, size, sort);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AliasControllerApi.GetAliasThreads: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
aliasId | Guid | aliasId | |
page | int? | Optional page index in thread list pagination | [optional] [default to 0] |
size | int? | Optional page size in thread list pagination | [optional] [default to 20] |
sort | string | Optional createdAt sort direction ASC or DESC | [optional] [default to ASC] |
# Return type
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# GetAliases
PageAlias GetAliases (int? page = null, int? size = null, string sort = null)
Get all email aliases you have created
Get all email aliases in paginated form
# Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
public class GetAliasesExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new AliasControllerApi(config);
var page = 56; // int? | Optional page index in alias list pagination (optional) (default to 0)
var size = 56; // int? | Optional page size in alias list pagination (optional) (default to 20)
var sort = sort_example; // string | Optional createdAt sort direction ASC or DESC (optional) (default to ASC)
try
{
// Get all email aliases you have created
PageAlias result = apiInstance.GetAliases(page, size, sort);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AliasControllerApi.GetAliases: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
page | int? | Optional page index in alias list pagination | [optional] [default to 0] |
size | int? | Optional page size in alias list pagination | [optional] [default to 20] |
sort | string | Optional createdAt sort direction ASC or DESC | [optional] [default to ASC] |
# Return type
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# ReplyToAliasEmail
SentEmailDto ReplyToAliasEmail (Guid aliasId, Guid emailId, ReplyToAliasEmailOptions 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
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
public class ReplyToAliasEmailExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new AliasControllerApi(config);
var aliasId = new Guid(); // Guid | ID of the alias that email belongs to
var emailId = new Guid(); // Guid | ID of the email that should be replied to
var replyToAliasEmailOptions = new ReplyToAliasEmailOptions(); // ReplyToAliasEmailOptions | replyToAliasEmailOptions
try
{
// Reply to an email
SentEmailDto result = apiInstance.ReplyToAliasEmail(aliasId, emailId, replyToAliasEmailOptions);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AliasControllerApi.ReplyToAliasEmail: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
aliasId | Guid | ID of the alias that email belongs to | |
emailId | Guid | ID of the email that should be replied to | |
replyToAliasEmailOptions | ReplyToAliasEmailOptions | replyToAliasEmailOptions |
# Return type
# Authorization
# HTTP request headers
- Content-Type: application/json
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
201 | Created | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# SendAliasEmail
SentEmailDto SendAliasEmail (Guid aliasId, SendEmailOptions sendEmailOptions = null)
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
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
public class SendAliasEmailExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new AliasControllerApi(config);
var aliasId = new Guid(); // Guid | aliasId
var sendEmailOptions = new SendEmailOptions(); // SendEmailOptions | Options for the email to be sent (optional)
try
{
// Send an email from an alias inbox
SentEmailDto result = apiInstance.SendAliasEmail(aliasId, sendEmailOptions);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AliasControllerApi.SendAliasEmail: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
aliasId | Guid | aliasId | |
sendEmailOptions | SendEmailOptions | Options for the email to be sent | [optional] |
# Return type
# Authorization
# HTTP request headers
- Content-Type: application/json
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
201 | Created | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# UpdateAlias
void UpdateAlias (Guid aliasId, UpdateAliasOptions updateAliasOptions)
Update an email alias
# Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
public class UpdateAliasExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.mailslurp.com";
// Configure API key authorization: API_KEY
config.AddApiKey("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("x-api-key", "Bearer");
var apiInstance = new AliasControllerApi(config);
var aliasId = new Guid(); // Guid | aliasId
var updateAliasOptions = new UpdateAliasOptions(); // UpdateAliasOptions | updateAliasOptions
try
{
// Update an email alias
apiInstance.UpdateAlias(aliasId, updateAliasOptions);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AliasControllerApi.UpdateAlias: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
aliasId | Guid | aliasId | |
updateAliasOptions | UpdateAliasOptions | updateAliasOptions |
# Return type
void (empty response body)
# Authorization
# HTTP request headers
- Content-Type: application/json
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
201 | Created | - |
202 | Accepted | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]