mailslurp_netstandard_2x.Api.DomainControllerApi
All URIs are relative to https://csharp.api.mailslurp.com
Method | HTTP request | Description |
---|---|---|
AddDomainWildcardCatchAll | POST /domains/{id}/wildcard | Add catch all wild card inbox to domain |
CreateDomain | POST /domains | Create Domain |
DeleteDomain | DELETE /domains/{id} | Delete a domain |
GetDomain | GET /domains/{id} | Get a domain |
GetDomains | GET /domains | Get domains |
UpdateDomain | PUT /domains/{id} | Update a domain |
DomainDto AddDomainWildcardCatchAll (Guid id)
Add catch all wild card inbox to domain
Add a catch all inbox to a domain so that any emails sent to it that cannot be matched will be sent to the catch all inbox generated
Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp_netstandard_2x.Api;
using mailslurp_netstandard_2x.Client;
using mailslurp_netstandard_2x.Model;
namespace Example
{
public class AddDomainWildcardCatchAllExample
{
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 DomainControllerApi(config);
var id = "id_example"; // Guid |
try
{
// Add catch all wild card inbox to domain
DomainDto result = apiInstance.AddDomainWildcardCatchAll(id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DomainControllerApi.AddDomainWildcardCatchAll: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Using the AddDomainWildcardCatchAllWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Add catch all wild card inbox to domain
ApiResponse<DomainDto> response = apiInstance.AddDomainWildcardCatchAllWithHttpInfo(id);
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 DomainControllerApi.AddDomainWildcardCatchAllWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | 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 ]
DomainDto CreateDomain (CreateDomainOptions createDomainOptions)
Create Domain
Link a domain that you own with MailSlurp so you can create email addresses using it. Endpoint returns DNS records used for validation. You must add these verification records to your host provider's DNS setup to verify the domain.
Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp_netstandard_2x.Api;
using mailslurp_netstandard_2x.Client;
using mailslurp_netstandard_2x.Model;
namespace Example
{
public class CreateDomainExample
{
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 DomainControllerApi(config);
var createDomainOptions = new CreateDomainOptions(); // CreateDomainOptions |
try
{
// Create Domain
DomainDto result = apiInstance.CreateDomain(createDomainOptions);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DomainControllerApi.CreateDomain: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Using the CreateDomainWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Create Domain
ApiResponse<DomainDto> response = apiInstance.CreateDomainWithHttpInfo(createDomainOptions);
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 DomainControllerApi.CreateDomainWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
createDomainOptions | CreateDomainOptions |
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 ]
List
DeleteDomain (Guid id)
Delete a domain
Delete a domain. This will disable any existing inboxes that use this domain.
Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp_netstandard_2x.Api;
using mailslurp_netstandard_2x.Client;
using mailslurp_netstandard_2x.Model;
namespace Example
{
public class DeleteDomainExample
{
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 DomainControllerApi(config);
var id = "id_example"; // Guid |
try
{
// Delete a domain
List<string> result = apiInstance.DeleteDomain(id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DomainControllerApi.DeleteDomain: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Using the DeleteDomainWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Delete a domain
ApiResponse<List<string>> response = apiInstance.DeleteDomainWithHttpInfo(id);
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 DomainControllerApi.DeleteDomainWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | Guid |
Return type
List
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
HTTP response details
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
[Back to top] [Back to API list] [Back to Model list] [Back to ]
DomainDto GetDomain (Guid id)
Get a domain
Returns domain verification status and tokens for a given domain
Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp_netstandard_2x.Api;
using mailslurp_netstandard_2x.Client;
using mailslurp_netstandard_2x.Model;
namespace Example
{
public class GetDomainExample
{
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 DomainControllerApi(config);
var id = "id_example"; // Guid |
try
{
// Get a domain
DomainDto result = apiInstance.GetDomain(id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DomainControllerApi.GetDomain: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Using the GetDomainWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Get a domain
ApiResponse<DomainDto> response = apiInstance.GetDomainWithHttpInfo(id);
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 DomainControllerApi.GetDomainWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | 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 ]
List
GetDomains ()
Get domains
List all custom domains you have created
Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp_netstandard_2x.Api;
using mailslurp_netstandard_2x.Client;
using mailslurp_netstandard_2x.Model;
namespace Example
{
public class GetDomainsExample
{
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 DomainControllerApi(config);
try
{
// Get domains
List<DomainPreview> result = apiInstance.GetDomains();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DomainControllerApi.GetDomains: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Using the GetDomainsWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Get domains
ApiResponse<List<DomainPreview>> response = apiInstance.GetDomainsWithHttpInfo();
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 DomainControllerApi.GetDomainsWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Parameters
This endpoint does not need any parameter.
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 ]
DomainDto UpdateDomain (Guid id, UpdateDomainOptions updateDomainOptions)
Update a domain
Update values on a domain. Note you cannot change the domain name as it is immutable. Recreate the domain if you need to alter this.
Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp_netstandard_2x.Api;
using mailslurp_netstandard_2x.Client;
using mailslurp_netstandard_2x.Model;
namespace Example
{
public class UpdateDomainExample
{
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 DomainControllerApi(config);
var id = "id_example"; // Guid |
var updateDomainOptions = new UpdateDomainOptions(); // UpdateDomainOptions |
try
{
// Update a domain
DomainDto result = apiInstance.UpdateDomain(id, updateDomainOptions);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DomainControllerApi.UpdateDomain: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Using the UpdateDomainWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Update a domain
ApiResponse<DomainDto> response = apiInstance.UpdateDomainWithHttpInfo(id, updateDomainOptions);
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 DomainControllerApi.UpdateDomainWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | Guid | ||
updateDomainOptions | UpdateDomainOptions |
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 ]