elasticemail/elasticemail-php
PHP client for Elastic Email’s REST API. Authenticate with your API key and manage campaigns and other resources via GET/POST/PUT/DELETE. Supports PHP 7.4+ (incl. 8.0) and uses Guzzle with configurable timeouts and connection limits.
All URIs are relative to https://api.elasticemail.com/v4, except if the operation defines another base path.
| Method | HTTP request | Description |
|---|---|---|
| statisticsCampaignsByNameGet() | GET /statistics/campaigns/{name} | Load Campaign Stats |
| statisticsCampaignsGet() | GET /statistics/campaigns | Load Campaigns Stats |
| statisticsChannelsByNameGet() | GET /statistics/channels/{name} | Load Channel Stats |
| statisticsChannelsGet() | GET /statistics/channels | Load Channels Stats |
| statisticsGet() | GET /statistics | Load Statistics |
statisticsCampaignsByNameGet()statisticsCampaignsByNameGet($name): \ElasticEmail\Model\ChannelLogStatusSummary
Load Campaign Stats
Retrieve stats of an existing campaign. Required Access Level: ViewChannels
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: apikey
$config = ElasticEmail\Configuration::getDefaultConfiguration()->setApiKey('X-ElasticEmail-ApiKey', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ElasticEmail\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-ElasticEmail-ApiKey', 'Bearer');
$apiInstance = new ElasticEmail\Api\StatisticsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$name = 'name_example'; // string | The name of the campaign to get.
try {
$result = $apiInstance->statisticsCampaignsByNameGet($name);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling StatisticsApi->statisticsCampaignsByNameGet: ', $e->getMessage(), PHP_EOL;
}
| Name | Type | Description | Notes |
|---|---|---|---|
| name | string | The name of the campaign to get. |
\ElasticEmail\Model\ChannelLogStatusSummary
application/json[Back to top] [Back to API list] [Back to Model list] [Back to README]
statisticsCampaignsGet()statisticsCampaignsGet($limit, $offset): \ElasticEmail\Model\ChannelLogStatusSummary[]
Load Campaigns Stats
Returns a list of your Campaigns' stats. Required Access Level: ViewChannels
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: apikey
$config = ElasticEmail\Configuration::getDefaultConfiguration()->setApiKey('X-ElasticEmail-ApiKey', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ElasticEmail\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-ElasticEmail-ApiKey', 'Bearer');
$apiInstance = new ElasticEmail\Api\StatisticsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$limit = 100; // int | Maximum number of returned items.
$offset = 20; // int | How many items should be returned ahead.
try {
$result = $apiInstance->statisticsCampaignsGet($limit, $offset);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling StatisticsApi->statisticsCampaignsGet: ', $e->getMessage(), PHP_EOL;
}
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | int | Maximum number of returned items. | [optional] |
| offset | int | How many items should be returned ahead. | [optional] |
\ElasticEmail\Model\ChannelLogStatusSummary[]
application/json[Back to top] [Back to API list] [Back to Model list] [Back to README]
statisticsChannelsByNameGet()statisticsChannelsByNameGet($name): \ElasticEmail\Model\ChannelLogStatusSummary
Load Channel Stats
Retrieve an existing channel stats. Required Access Level: ViewChannels
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: apikey
$config = ElasticEmail\Configuration::getDefaultConfiguration()->setApiKey('X-ElasticEmail-ApiKey', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ElasticEmail\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-ElasticEmail-ApiKey', 'Bearer');
$apiInstance = new ElasticEmail\Api\StatisticsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$name = 'name_example'; // string | The name of the channel to get.
try {
$result = $apiInstance->statisticsChannelsByNameGet($name);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling StatisticsApi->statisticsChannelsByNameGet: ', $e->getMessage(), PHP_EOL;
}
| Name | Type | Description | Notes |
|---|---|---|---|
| name | string | The name of the channel to get. |
\ElasticEmail\Model\ChannelLogStatusSummary
application/json[Back to top] [Back to API list] [Back to Model list] [Back to README]
statisticsChannelsGet()statisticsChannelsGet($limit, $offset): \ElasticEmail\Model\ChannelLogStatusSummary[]
Load Channels Stats
Returns a list of your Channels' stats. Required Access Level: ViewChannels
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: apikey
$config = ElasticEmail\Configuration::getDefaultConfiguration()->setApiKey('X-ElasticEmail-ApiKey', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ElasticEmail\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-ElasticEmail-ApiKey', 'Bearer');
$apiInstance = new ElasticEmail\Api\StatisticsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$limit = 100; // int | Maximum number of returned items.
$offset = 20; // int | How many items should be returned ahead.
try {
$result = $apiInstance->statisticsChannelsGet($limit, $offset);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling StatisticsApi->statisticsChannelsGet: ', $e->getMessage(), PHP_EOL;
}
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | int | Maximum number of returned items. | [optional] |
| offset | int | How many items should be returned ahead. | [optional] |
\ElasticEmail\Model\ChannelLogStatusSummary[]
application/json[Back to top] [Back to API list] [Back to Model list] [Back to README]
statisticsGet()statisticsGet($from, $to): \ElasticEmail\Model\LogStatusSummary
Load Statistics
Returns basic statistics. Required Access Level: ViewReports
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: apikey
$config = ElasticEmail\Configuration::getDefaultConfiguration()->setApiKey('X-ElasticEmail-ApiKey', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ElasticEmail\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-ElasticEmail-ApiKey', 'Bearer');
$apiInstance = new ElasticEmail\Api\StatisticsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$from = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | Starting date for search in YYYY-MM-DDThh:mm:ss format.
$to = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | Ending date for search in YYYY-MM-DDThh:mm:ss format.
try {
$result = $apiInstance->statisticsGet($from, $to);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling StatisticsApi->statisticsGet: ', $e->getMessage(), PHP_EOL;
}
| Name | Type | Description | Notes |
|---|---|---|---|
| from | \DateTime | Starting date for search in YYYY-MM-DDThh:mm:ss format. | |
| to | \DateTime | Ending date for search in YYYY-MM-DDThh:mm:ss format. | [optional] |
\ElasticEmail\Model\LogStatusSummary
application/json[Back to top] [Back to API list] [Back to Model list] [Back to README]
How can I help you explore Laravel packages today?