mailslurp.Api.TemplateControllerApi

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

MethodHTTP requestDescription
CreateTemplatePOST /templatesCreate a Template
DeleteTemplateDELETE /templates/{TemplateId}Delete Template
GetAllTemplatesGET /templates/paginatedGet all Templates in paginated format
GetTemplateGET /templates/{TemplateId}Get Template
GetTemplatesGET /templatesGet all Templates

CreateTemplate

TemplateDto CreateTemplate (CreateTemplateOptions createTemplateOptions)

Create a Template

Example

using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;

namespace Example
{
    public class CreateTemplateExample
    {
        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 TemplateControllerApi(config);
            var createTemplateOptions = new CreateTemplateOptions(); // CreateTemplateOptions | createTemplateOptions

            try
            {
                // Create a Template
                TemplateDto result = apiInstance.CreateTemplate(createTemplateOptions);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling TemplateControllerApi.CreateTemplate: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
createTemplateOptionsCreateTemplateOptionscreateTemplateOptions

Return type

TemplateDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
201Created-
401Unauthorized-
403Forbidden-
404Not Found-

[Back to top] [Back to API list] [Back to Model list] [Back to ]

DeleteTemplate

void DeleteTemplate (Guid templateId)

Delete Template

Example

using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;

namespace Example
{
    public class DeleteTemplateExample
    {
        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 TemplateControllerApi(config);
            var templateId = new Guid(); // Guid | TemplateId

            try
            {
                // Delete Template
                apiInstance.DeleteTemplate(templateId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling TemplateControllerApi.DeleteTemplate: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
templateIdGuidTemplateId

Return type

void (empty response body)

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status codeDescriptionResponse headers
204No Content-
401Unauthorized-
403Forbidden-

[Back to top] [Back to API list] [Back to Model list] [Back to ]

GetAllTemplates

PageTemplateProjection GetAllTemplates (int? page = null, int? size = null, string sort = null)

Get all Templates in paginated format

Example

using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;

namespace Example
{
    public class GetAllTemplatesExample
    {
        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 TemplateControllerApi(config);
            var page = 56;  // int? | Optional page  in inbox list pagination (optional)  (default to 0)
            var size = 56;  // int? | Optional page size in inbox 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 Templates in paginated format
                PageTemplateProjection result = apiInstance.GetAllTemplates(page, size, sort);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling TemplateControllerApi.GetAllTemplates: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
pageint?Optional page in inbox list pagination[optional] [default to 0]
sizeint?Optional page size in inbox list pagination[optional] [default to 20]
sortstringOptional createdAt sort direction ASC or DESC[optional] [default to ASC]

Return type

PageTemplateProjection

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-
403Forbidden-
404Not Found-

[Back to top] [Back to API list] [Back to Model list] [Back to ]

GetTemplate

TemplateDto GetTemplate (Guid templateId)

Get Template

Example

using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;

namespace Example
{
    public class GetTemplateExample
    {
        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 TemplateControllerApi(config);
            var templateId = new Guid(); // Guid | TemplateId

            try
            {
                // Get Template
                TemplateDto result = apiInstance.GetTemplate(templateId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling TemplateControllerApi.GetTemplate: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
templateIdGuidTemplateId

Return type

TemplateDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-
403Forbidden-
404Not Found-

[Back to top] [Back to API list] [Back to Model list] [Back to ]

GetTemplates

List GetTemplates ()

Get all Templates

Example

using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;

namespace Example
{
    public class GetTemplatesExample
    {
        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 TemplateControllerApi(config);

            try
            {
                // Get all Templates
                List<TemplateProjection> result = apiInstance.GetTemplates();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling TemplateControllerApi.GetTemplates: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

List

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200OK-
401Unauthorized-
403Forbidden-
404Not Found-

[Back to top] [Back to API list] [Back to Model list] [Back to ]