Skip to content

TrackingControllerApi

All URIs are relative to https://java.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)

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

// Import classes:
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.auth.*;
import com.mailslurp.clients.models.*;
import com.mailslurp.apis.TrackingControllerApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://java.api.mailslurp.com");

    // Configure API key authorization: API_KEY
    ApiKeyAuth API_KEY = (ApiKeyAuth) defaultClient.getAuthentication("API_KEY");
    API_KEY.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //API_KEY.setApiKeyPrefix("Token");

    TrackingControllerApi apiInstance = new TrackingControllerApi(defaultClient);
    CreateTrackingPixelOptions createTrackingPixelOptions = new CreateTrackingPixelOptions(); // CreateTrackingPixelOptions | 
    try {
      TrackingPixelDto result = apiInstance.createTrackingPixel(createTrackingPixelOptions);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling TrackingControllerApi#createTrackingPixel");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
createTrackingPixelOptions CreateTrackingPixelOptions

Return type

TrackingPixelDto

Authorization

API_KEY

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 Created -

PageTrackingPixelProjection getAllTrackingPixels(page, size, sort, searchFilter, since, before)

Get tracking pixels

List tracking pixels in paginated form

Example

// Import classes:
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.auth.*;
import com.mailslurp.clients.models.*;
import com.mailslurp.apis.TrackingControllerApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://java.api.mailslurp.com");

    // Configure API key authorization: API_KEY
    ApiKeyAuth API_KEY = (ApiKeyAuth) defaultClient.getAuthentication("API_KEY");
    API_KEY.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //API_KEY.setApiKeyPrefix("Token");

    TrackingControllerApi apiInstance = new TrackingControllerApi(defaultClient);
    Integer page = 0; // Integer | Optional page  in list pagination
    Integer size = 20; // Integer | Optional page size in list pagination
    String sort = "ASC"; // String | Optional createdAt sort direction ASC or DESC
    String searchFilter = "searchFilter_example"; // String | Optional search filter
    OffsetDateTime since = new OffsetDateTime(); // OffsetDateTime | Filter by created at after the given timestamp
    OffsetDateTime before = new OffsetDateTime(); // OffsetDateTime | Filter by created at before the given timestamp
    try {
      PageTrackingPixelProjection result = apiInstance.getAllTrackingPixels(page, size, sort, searchFilter, since, before);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling TrackingControllerApi#getAllTrackingPixels");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
page Integer Optional page in list pagination [optional] [default to 0]
size Integer Optional page size in list pagination [optional] [default to 20]
sort String Optional createdAt sort direction ASC or DESC [optional] [default to ASC] [enum: ASC, DESC]
searchFilter String Optional search filter [optional]
since OffsetDateTime Filter by created at after the given timestamp [optional]
before OffsetDateTime Filter by created at before the given timestamp [optional]

Return type

PageTrackingPixelProjection

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -

TrackingPixelDto getTrackingPixel(id)

Get pixel

Example

// Import classes:
import com.mailslurp.clients.ApiClient;
import com.mailslurp.clients.ApiException;
import com.mailslurp.clients.Configuration;
import com.mailslurp.clients.auth.*;
import com.mailslurp.clients.models.*;
import com.mailslurp.apis.TrackingControllerApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://java.api.mailslurp.com");

    // Configure API key authorization: API_KEY
    ApiKeyAuth API_KEY = (ApiKeyAuth) defaultClient.getAuthentication("API_KEY");
    API_KEY.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //API_KEY.setApiKeyPrefix("Token");

    TrackingControllerApi apiInstance = new TrackingControllerApi(defaultClient);
    UUID id = new UUID(); // UUID | 
    try {
      TrackingPixelDto result = apiInstance.getTrackingPixel(id);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling TrackingControllerApi#getTrackingPixel");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
id UUID

Return type

TrackingPixelDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status code Description Response headers
200 OK -