MailSlurp\TrackingControllerApi
All URIs are relative to https://php.api.mailslurp.com, except if the operation defines another base path.
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 |
createTrackingPixel()
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
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
$apiInstance = new MailSlurpApiTrackingControllerApi(
// If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
// This is optional, `GuzzleHttpClient` will be used as default.
new GuzzleHttpClient(),
$config
);
$create_tracking_pixel_options = new MailSlurpModelsCreateTrackingPixelOptions(); // MailSlurpModelsCreateTrackingPixelOptions
try {
$result = $apiInstance->createTrackingPixel($create_tracking_pixel_options);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TrackingControllerApi->createTrackingPixel: ', $e->getMessage(), PHP_EOL;
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
create_tracking_pixel_options | MailSlurpModelsCreateTrackingPixelOptions |
Return type
MailSlurpModelsTrackingPixelDto
Authorization
HTTP request headers
- Content-Type:
application/json
- Accept:
*/*
[Back to top] [Back to API list] [Back to Model list] [Back to ]
getAllTrackingPixels()
getAllTrackingPixels($page, $size, $sort, $search_filter, $since, $before): MailSlurpModelsPageTrackingPixelProjection
Get tracking pixels
List tracking pixels in paginated form
Example
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
$apiInstance = new MailSlurpApiTrackingControllerApi(
// If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
// This is optional, `GuzzleHttpClient` will be used as default.
new GuzzleHttpClient(),
$config
);
$page = 0; // int | Optional page in list pagination
$size = 20; // int | Optional page size in list pagination
$sort = 'ASC'; // string | Optional createdAt sort direction ASC or DESC
$search_filter = 'search_filter_example'; // string | Optional search filter
$since = new DateTime("2013-10-20T19:20:30+01:00"); // DateTime | Filter by created at after the given timestamp
$before = new DateTime("2013-10-20T19:20:30+01:00"); // DateTime | Filter by created at before the given timestamp
try {
$result = $apiInstance->getAllTrackingPixels($page, $size, $sort, $search_filter, $since, $before);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TrackingControllerApi->getAllTrackingPixels: ', $e->getMessage(), PHP_EOL;
}
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'] |
search_filter | 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
MailSlurpModelsPageTrackingPixelProjection
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept:
*/*
[Back to top] [Back to API list] [Back to Model list] [Back to ]
getTrackingPixel()
Get pixel
Example
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
$apiInstance = new MailSlurpApiTrackingControllerApi(
// If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
// This is optional, `GuzzleHttpClient` will be used as default.
new GuzzleHttpClient(),
$config
);
$id = 'id_example'; // string
try {
$result = $apiInstance->getTrackingPixel($id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TrackingControllerApi->getTrackingPixel: ', $e->getMessage(), PHP_EOL;
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | string |
Return type
MailSlurpModelsTrackingPixelDto
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept:
*/*
[Back to top] [Back to API list] [Back to Model list] [Back to ]