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 |
|---|---|---|
| suppressionsBouncesGet() | GET /suppressions/bounces | Get Bounce List |
| suppressionsBouncesImportPost() | POST /suppressions/bounces/import | Add Bounces Async |
| suppressionsBouncesPost() | POST /suppressions/bounces | Add Bounces |
| suppressionsByEmailDelete() | DELETE /suppressions/{email} | Delete Suppression |
| suppressionsByEmailGet() | GET /suppressions/{email} | Get Suppression |
| suppressionsComplaintsGet() | GET /suppressions/complaints | Get Complaints List |
| suppressionsComplaintsImportPost() | POST /suppressions/complaints/import | Add Complaints Async |
| suppressionsComplaintsPost() | POST /suppressions/complaints | Add Complaints |
| suppressionsGet() | GET /suppressions | Get Suppressions |
| suppressionsUnsubscribesGet() | GET /suppressions/unsubscribes | Get Unsubscribes List |
| suppressionsUnsubscribesImportPost() | POST /suppressions/unsubscribes/import | Add Unsubscribes Async |
| suppressionsUnsubscribesPost() | POST /suppressions/unsubscribes | Add Unsubscribes |
suppressionsBouncesGet()suppressionsBouncesGet($search, $limit, $offset): \ElasticEmail\Model\Suppression[]
Get Bounce List
Retrieve your list of bounced emails. Required Access Level: ViewContacts, ViewSuppressions
<?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\SuppressionsApi(
// 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
);
$search = text; // string | Text fragment used for searching.
$limit = 100; // int | Maximum number of returned items.
$offset = 20; // int | How many items should be returned ahead.
try {
$result = $apiInstance->suppressionsBouncesGet($search, $limit, $offset);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SuppressionsApi->suppressionsBouncesGet: ', $e->getMessage(), PHP_EOL;
}
| Name | Type | Description | Notes |
|---|---|---|---|
| search | string | Text fragment used for searching. | [optional] |
| limit | int | Maximum number of returned items. | [optional] |
| offset | int | How many items should be returned ahead. | [optional] |
\ElasticEmail\Model\Suppression[]
application/json[Back to top] [Back to API list] [Back to Model list] [Back to README]
suppressionsBouncesImportPost()suppressionsBouncesImportPost($file)
Add Bounces Async
Add Bounced. Required Access Level: ModifyContacts, ModifySuppressions
<?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\SuppressionsApi(
// 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
);
$file = '/path/to/file.txt'; // \SplFileObject
try {
$apiInstance->suppressionsBouncesImportPost($file);
} catch (Exception $e) {
echo 'Exception when calling SuppressionsApi->suppressionsBouncesImportPost: ', $e->getMessage(), PHP_EOL;
}
| Name | Type | Description | Notes |
|---|---|---|---|
| file | \SplFileObject**\SplFileObject** | [optional] |
void (empty response body)
multipart/form-data[Back to top] [Back to API list] [Back to Model list] [Back to README]
suppressionsBouncesPost()suppressionsBouncesPost($request_body): \ElasticEmail\Model\Suppression[]
Add Bounces
Add Bounced. Required Access Level: ModifyContacts, ModifySuppressions
<?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\SuppressionsApi(
// 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
);
$request_body = array('request_body_example'); // string[] | Emails to add as bounces. Limited to 1000 per request
try {
$result = $apiInstance->suppressionsBouncesPost($request_body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SuppressionsApi->suppressionsBouncesPost: ', $e->getMessage(), PHP_EOL;
}
| Name | Type | Description | Notes |
|---|---|---|---|
| request_body | string[] | Emails to add as bounces. Limited to 1000 per request |
\ElasticEmail\Model\Suppression[]
application/jsonapplication/json[Back to top] [Back to API list] [Back to Model list] [Back to README]
suppressionsByEmailDelete()suppressionsByEmailDelete($email)
Delete Suppression
Delete Suppression. Required Access Level: ViewContacts, ViewSuppressions
<?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\SuppressionsApi(
// 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
);
$email = mail@example.com; // string | Proper email address.
try {
$apiInstance->suppressionsByEmailDelete($email);
} catch (Exception $e) {
echo 'Exception when calling SuppressionsApi->suppressionsByEmailDelete: ', $e->getMessage(), PHP_EOL;
}
| Name | Type | Description | Notes |
|---|---|---|---|
| string | Proper email address. |
void (empty response body)
[Back to top] [Back to API list] [Back to Model list] [Back to README]
suppressionsByEmailGet()suppressionsByEmailGet($email): \ElasticEmail\Model\Suppression
Get Suppression
Retrieve your suppression. Required Access Level: ViewContacts, ViewSuppressions
<?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\SuppressionsApi(
// 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
);
$email = mail@example.com; // string | Proper email address.
try {
$result = $apiInstance->suppressionsByEmailGet($email);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SuppressionsApi->suppressionsByEmailGet: ', $e->getMessage(), PHP_EOL;
}
| Name | Type | Description | Notes |
|---|---|---|---|
| string | Proper email address. |
\ElasticEmail\Model\Suppression
application/json[Back to top] [Back to API list] [Back to Model list] [Back to README]
suppressionsComplaintsGet()suppressionsComplaintsGet($search, $limit, $offset): \ElasticEmail\Model\Suppression[]
Get Complaints List
Retrieve your list of complaints. Required Access Level: ViewContacts, ViewSuppressions
<?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\SuppressionsApi(
// 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
);
$search = text; // string | Text fragment used for searching.
$limit = 100; // int | Maximum number of returned items.
$offset = 20; // int | How many items should be returned ahead.
try {
$result = $apiInstance->suppressionsComplaintsGet($search, $limit, $offset);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SuppressionsApi->suppressionsComplaintsGet: ', $e->getMessage(), PHP_EOL;
}
| Name | Type | Description | Notes |
|---|---|---|---|
| search | string | Text fragment used for searching. | [optional] |
| limit | int | Maximum number of returned items. | [optional] |
| offset | int | How many items should be returned ahead. | [optional] |
\ElasticEmail\Model\Suppression[]
application/json[Back to top] [Back to API list] [Back to Model list] [Back to README]
suppressionsComplaintsImportPost()suppressionsComplaintsImportPost($file)
Add Complaints Async
Add Complaints. Required Access Level: ModifyContacts, ModifySuppressions
<?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\SuppressionsApi(
// 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
);
$file = '/path/to/file.txt'; // \SplFileObject
try {
$apiInstance->suppressionsComplaintsImportPost($file);
} catch (Exception $e) {
echo 'Exception when calling SuppressionsApi->suppressionsComplaintsImportPost: ', $e->getMessage(), PHP_EOL;
}
| Name | Type | Description | Notes |
|---|---|---|---|
| file | \SplFileObject**\SplFileObject** | [optional] |
void (empty response body)
multipart/form-data[Back to top] [Back to API list] [Back to Model list] [Back to README]
suppressionsComplaintsPost()suppressionsComplaintsPost($request_body): \ElasticEmail\Model\Suppression[]
Add Complaints
Add Complaints. Required Access Level: ModifyContacts, ModifySuppressions
<?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\SuppressionsApi(
// 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
);
$request_body = array('request_body_example'); // string[] | Emails to add as complaints. Limited to 1000 per request
try {
$result = $apiInstance->suppressionsComplaintsPost($request_body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SuppressionsApi->suppressionsComplaintsPost: ', $e->getMessage(), PHP_EOL;
}
| Name | Type | Description | Notes |
|---|---|---|---|
| request_body | string[] | Emails to add as complaints. Limited to 1000 per request |
\ElasticEmail\Model\Suppression[]
application/jsonapplication/json[Back to top] [Back to API list] [Back to Model list] [Back to README]
suppressionsGet()suppressionsGet($limit, $offset): \ElasticEmail\Model\Suppression[]
Get Suppressions
Retrieve your suppressions. Required Access Level: ViewContacts, ViewSuppressions
<?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\SuppressionsApi(
// 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->suppressionsGet($limit, $offset);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SuppressionsApi->suppressionsGet: ', $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\Suppression[]
application/json[Back to top] [Back to API list] [Back to Model list] [Back to README]
suppressionsUnsubscribesGet()suppressionsUnsubscribesGet($search, $limit, $offset): \ElasticEmail\Model\Suppression[]
Get Unsubscribes List
Retrieve your list of unsubscribes. Required Access Level: ViewContacts, ViewSuppressions
<?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\SuppressionsApi(
// 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
);
$search = text; // string | Text fragment used for searching.
$limit = 100; // int | Maximum number of returned items.
$offset = 20; // int | How many items should be returned ahead.
try {
$result = $apiInstance->suppressionsUnsubscribesGet($search, $limit, $offset);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SuppressionsApi->suppressionsUnsubscribesGet: ', $e->getMessage(), PHP_EOL;
}
| Name | Type | Description | Notes |
|---|---|---|---|
| search | string | Text fragment used for searching. | [optional] |
| limit | int | Maximum number of returned items. | [optional] |
| offset | int | How many items should be returned ahead. | [optional] |
\ElasticEmail\Model\Suppression[]
application/json[Back to top] [Back to API list] [Back to Model list] [Back to README]
suppressionsUnsubscribesImportPost()suppressionsUnsubscribesImportPost($file)
Add Unsubscribes Async
Add Unsubscribes. Required Access Level: ModifyContacts, ModifySuppressions
<?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\SuppressionsApi(
// 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
);
$file = '/path/to/file.txt'; // \SplFileObject
try {
$apiInstance->suppressionsUnsubscribesImportPost($file);
} catch (Exception $e) {
echo 'Exception when calling SuppressionsApi->suppressionsUnsubscribesImportPost: ', $e->getMessage(), PHP_EOL;
}
| Name | Type | Description | Notes |
|---|---|---|---|
| file | **\SplFileObject.... |
How can I help you explore Laravel packages today?