mailslurp.Api.TrackingControllerApi
All URIs are relative to https://api.mailslurp.com
Method | HTTP request | Description |
---|---|---|
CreateTrackingPixel | POST /tracking/pixels | Create tracking pixel |
GetAllTrackingPixels | GET /tracking/pixels | Get tracking pixels |
GetTrackingPixel | GET /tracking/pixels/{id} | Get pixel |
TrackingPixelDto CreateTrackingPixel (CreateTrackingPixelOptions createTrackingPixelOptions)
Create tracking pixel
Create a tracking pixel. A tracking pixel is an image that can be embedded in an email. When the email is viewed and the image is seen MailSlurp will mark the pixel as seen. Use tracking pixels to monitor email open events. You can receive open notifications via webhook or by fetching the pixel.
Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
public class CreateTrackingPixelExample
{
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 TrackingControllerApi(config);
var createTrackingPixelOptions = new CreateTrackingPixelOptions(); // CreateTrackingPixelOptions |
try
{
// Create tracking pixel
TrackingPixelDto result = apiInstance.CreateTrackingPixel(createTrackingPixelOptions);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling TrackingControllerApi.CreateTrackingPixel: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
createTrackingPixelOptions | CreateTrackingPixelOptions |
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 ]
PageTrackingPixelProjection GetAllTrackingPixels (int? page = null, int? size = null, string sort = null, string searchFilter = null, DateTime? since = null, DateTime? before = null)
Get tracking pixels
List tracking pixels in paginated form
Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
public class GetAllTrackingPixelsExample
{
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 TrackingControllerApi(config);
var page = 56; // int? | Optional page in list pagination (optional) (default to 0)
var size = 56; // int? | Optional page size in list pagination (optional) (default to 20)
var sort = sort_example; // string | Optional createdAt sort direction ASC or DESC (optional) (default to ASC)
var searchFilter = searchFilter_example; // string | Optional search filter (optional)
var since = 2013-10-20T19:20:30+01:00; // DateTime? | Filter by created at after the given timestamp (optional)
var before = 2013-10-20T19:20:30+01:00; // DateTime? | Filter by created at before the given timestamp (optional)
try
{
// Get tracking pixels
PageTrackingPixelProjection result = apiInstance.GetAllTrackingPixels(page, size, sort, searchFilter, since, before);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling TrackingControllerApi.GetAllTrackingPixels: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
page | int? | Optional page in list pagination | [optional] [default to 0] |
size | int? | Optional page size in list pagination | [optional] [default to 20] |
sort | string | Optional createdAt sort direction ASC or DESC | [optional] [default to ASC] |
searchFilter | string | Optional search filter | [optional] |
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 ]
TrackingPixelDto GetTrackingPixel (Guid id)
Get pixel
Example
using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
public class GetTrackingPixelExample
{
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 TrackingControllerApi(config);
var id = new Guid(); // Guid |
try
{
// Get pixel
TrackingPixelDto result = apiInstance.GetTrackingPixel(id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling TrackingControllerApi.GetTrackingPixel: " + 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 ]