MailSlurpClient::TrackingControllerApi

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

MethodHTTP requestDescription
create_tracking_pixelPOST /tracking/pixelsCreate tracking pixel
get_all_tracking_pixelsGET /tracking/pixelsGet tracking pixels
get_tracking_pixelGET /tracking/pixels/{id}Get pixel

create_tracking_pixel

TrackingPixelDto create_tracking_pixel(create_tracking_pixel_options)

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

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::TrackingControllerApi.new
create_tracking_pixel_options = MailSlurpClient::CreateTrackingPixelOptions.new # CreateTrackingPixelOptions | createTrackingPixelOptions

begin
  #Create tracking pixel
  result = api_instance.create_tracking_pixel(create_tracking_pixel_options)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling TrackingControllerApi->create_tracking_pixel: #{e}"
end

Parameters

NameTypeDescriptionNotes
create_tracking_pixel_optionsCreateTrackingPixelOptionscreateTrackingPixelOptions

Return type

TrackingPixelDto

Authorization

API_KEY

HTTP request headers

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

get_all_tracking_pixels

PageTrackingPixelProjection get_all_tracking_pixels(opts)

Get tracking pixels

List tracking pixels in paginated form

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::TrackingControllerApi.new
opts = {
  page: 0, # Integer | Optional page  in list pagination
  search_filter: 'search_filter_example', # String | Optional search filter
  size: 20, # Integer | Optional page size in list pagination
  sort: 'ASC' # String | Optional createdAt sort direction ASC or DESC
}

begin
  #Get tracking pixels
  result = api_instance.get_all_tracking_pixels(opts)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling TrackingControllerApi->get_all_tracking_pixels: #{e}"
end

Parameters

NameTypeDescriptionNotes
pageIntegerOptional page in list pagination[optional] [default to 0]
search_filterStringOptional search filter[optional]
sizeIntegerOptional page size in list pagination[optional] [default to 20]
sortStringOptional createdAt sort direction ASC or DESC[optional] [default to ‘ASC’]

Return type

PageTrackingPixelProjection

Authorization

API_KEY

HTTP request headers

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

get_tracking_pixel

TrackingPixelDto get_tracking_pixel(id)

Get pixel

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::TrackingControllerApi.new
id = 'id_example' # String | id

begin
  #Get pixel
  result = api_instance.get_tracking_pixel(id)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling TrackingControllerApi->get_tracking_pixel: #{e}"
end

Parameters

NameTypeDescriptionNotes
idStringid

Return type

TrackingPixelDto

Authorization

API_KEY

HTTP request headers

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