mailslurp.Api.AliasControllerApi
All URIs are relative to https://csharp.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 |
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://csharp.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 |
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);
}
}
}
}
Using the CreateAliasWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
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.
ApiResponse<AliasDto> response = apiInstance.CreateAliasWithHttpInfo(createAliasOptions);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AliasControllerApi.CreateAliasWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
createAliasOptions | CreateAliasOptions |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: /
HTTP response details
Status code | Description | Response headers |
---|---|---|
201 | Created | - |
[Back to top] [Back to API list] [Back to Model list] [Back to ]
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://csharp.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 = "aliasId_example"; // Guid |
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);
}
}
}
}
Using the DeleteAliasWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Delete an email alias
apiInstance.DeleteAliasWithHttpInfo(aliasId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AliasControllerApi.DeleteAliasWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
aliasId | Guid |
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 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to ]
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://csharp.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 = "aliasId_example"; // Guid |
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);
}
}
}
}
Using the GetAliasWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Get an email alias
ApiResponse<AliasDto> response = apiInstance.GetAliasWithHttpInfo(aliasId);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AliasControllerApi.GetAliasWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
aliasId | Guid |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to ]
PageEmailProjection GetAliasEmails (Guid aliasId, int? page = null, int? size = null, string sort = null, DateTime? since = null, DateTime? before = 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://csharp.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 = "aliasId_example"; // Guid |
var page = 0; // int? | Optional page alias email list pagination (optional) (default to 0)
var size = 20; // int? | Optional page size alias email list pagination (optional) (default to 20)
var sort = "ASC"; // string | Optional createdAt sort direction ASC or DESC (optional) (default to ASC)
var since = DateTime.Parse("2013-10-20T19:20:30+01:00"); // DateTime? | Optional filter by sent after given date time (optional)
var before = DateTime.Parse("2013-10-20T19:20:30+01:00"); // DateTime? | Optional filter by sent before given date time (optional)
try
{
// Get emails for an alias
PageEmailProjection result = apiInstance.GetAliasEmails(aliasId, page, size, sort, since, before);
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);
}
}
}
}
Using the GetAliasEmailsWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Get emails for an alias
ApiResponse<PageEmailProjection> response = apiInstance.GetAliasEmailsWithHttpInfo(aliasId, page, size, sort, since, before);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AliasControllerApi.GetAliasEmailsWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
aliasId | Guid | ||
page | int? | Optional page 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] |
since | DateTime? | Optional filter by sent after given date time | [optional] |
before | DateTime? | Optional filter by sent before given date time | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to ]
PageThreadProjection GetAliasThreads (Guid aliasId, int? page = null, int? size = null, string sort = null, DateTime? since = null, DateTime? before = 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://csharp.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 = "aliasId_example"; // Guid |
var page = 0; // int? | Optional page in thread list pagination (optional) (default to 0)
var size = 20; // int? | Optional page size in thread list pagination (optional) (default to 20)
var sort = "ASC"; // string | Optional createdAt sort direction ASC or DESC (optional) (default to ASC)
var since = DateTime.Parse("2013-10-20T19:20:30+01:00"); // DateTime? | Optional filter by sent after given date time (optional)
var before = DateTime.Parse("2013-10-20T19:20:30+01:00"); // DateTime? | Optional filter by sent before given date time (optional)
try
{
// Get threads created for an alias
PageThreadProjection result = apiInstance.GetAliasThreads(aliasId, page, size, sort, since, before);
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);
}
}
}
}
Using the GetAliasThreadsWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Get threads created for an alias
ApiResponse<PageThreadProjection> response = apiInstance.GetAliasThreadsWithHttpInfo(aliasId, page, size, sort, since, before);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AliasControllerApi.GetAliasThreadsWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
aliasId | Guid | ||
page | int? | Optional page 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] |
since | DateTime? | Optional filter by sent after given date time | [optional] |
before | DateTime? | Optional filter by sent before given date time | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to ]
PageAlias GetAliases (int? page = null, int? size = null, string sort = null, DateTime? since = null, DateTime? before = 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://csharp.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 = 0; // int? | Optional page in alias list pagination (optional) (default to 0)
var size = 20; // int? | Optional page size in alias list pagination (optional) (default to 20)
var sort = "ASC"; // string | Optional createdAt sort direction ASC or DESC (optional) (default to ASC)
var since = DateTime.Parse("2013-10-20T19:20:30+01:00"); // DateTime? | Filter by created at after the given timestamp (optional)
var before = DateTime.Parse("2013-10-20T19:20:30+01:00"); // DateTime? | Filter by created at before the given timestamp (optional)
try
{
// Get all email aliases you have created
PageAlias result = apiInstance.GetAliases(page, size, sort, since, before);
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);
}
}
}
}
Using the GetAliasesWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Get all email aliases you have created
ApiResponse<PageAlias> response = apiInstance.GetAliasesWithHttpInfo(page, size, sort, since, before);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AliasControllerApi.GetAliasesWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
page | int? | Optional page 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] |
since | DateTime? | Filter by created at after the given timestamp | [optional] |
before | DateTime? | Filter by created at before the given timestamp | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to ]
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://csharp.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 = "aliasId_example"; // Guid | ID of the alias that email belongs to
var emailId = "emailId_example"; // Guid | ID of the email that should be replied to
var replyToAliasEmailOptions = new 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);
}
}
}
}
Using the ReplyToAliasEmailWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Reply to an email
ApiResponse<SentEmailDto> response = apiInstance.ReplyToAliasEmailWithHttpInfo(aliasId, emailId, replyToAliasEmailOptions);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AliasControllerApi.ReplyToAliasEmailWithHttpInfo: " + 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 |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: /
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to ]
SentEmailDto SendAliasEmail (Guid aliasId, SendEmailOptions 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
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://csharp.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 = "aliasId_example"; // Guid |
var sendEmailOptions = new SendEmailOptions(); // SendEmailOptions |
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);
}
}
}
}
Using the SendAliasEmailWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Send an email from an alias inbox
ApiResponse<SentEmailDto> response = apiInstance.SendAliasEmailWithHttpInfo(aliasId, sendEmailOptions);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AliasControllerApi.SendAliasEmailWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
aliasId | Guid | ||
sendEmailOptions | SendEmailOptions |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: /
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to ]
AliasDto 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://csharp.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 = "aliasId_example"; // Guid |
var updateAliasOptions = new UpdateAliasOptions(); // UpdateAliasOptions |
try
{
// Update an email alias
AliasDto result = apiInstance.UpdateAlias(aliasId, updateAliasOptions);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AliasControllerApi.UpdateAlias: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Using the UpdateAliasWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Update an email alias
ApiResponse<AliasDto> response = apiInstance.UpdateAliasWithHttpInfo(aliasId, updateAliasOptions);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AliasControllerApi.UpdateAliasWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
aliasId | Guid | ||
updateAliasOptions | UpdateAliasOptions |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: /
HTTP response details
Status code | Description | Response headers |
---|---|---|
202 | Accepted | - |
[Back to top] [Back to API list] [Back to Model list] [Back to ]