elasticemail/elasticemail-php

The PHP library for the Elastic Email REST API. This API is based on the REST API architecture, allowing the user to easily manage their data with this resource-based approach. To start using this API, you will need your Access Token. Remember to keep it safe.

4.0.23 2023-11-27 14:28 UTC

This package is auto-updated.

Last update: 2024-04-27 15:42:30 UTC


README

This API is based on the REST API architecture, allowing the user to easily manage their data with this resource-based approach.

Every API call is established on which specific request type (GET, POST, PUT, DELETE) will be used.

The API has a limit of 20 concurrent connections and a hard timeout of 600 seconds per request.

To start using this API, you will need your Access Token (available here). Remember to keep it safe. Required access levels are listed in the given request’s description.

Downloadable library clients can be found in our Github repository here

Installation & Usage

Requirements

PHP 7.4 and later. Should also work with PHP 8.0.

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/elasticemail/elasticemail-php.git"
    }
  ],
  "require": {
    "elasticemail/elasticemail-php": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/ElasticEmail/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?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\CampaignsApi(
    // 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 | Name of Campaign to delete

try {
    $apiInstance->campaignsByNameDelete($name);
} catch (Exception $e) {
    echo 'Exception when calling CampaignsApi->campaignsByNameDelete: ', $e->getMessage(), PHP_EOL;
}

Examples

Function
addCampaign readme
addBulkContacts readme
addSingleContact readme
addList readme
addTemplate readme
deleteCampaign readme
deleteContact readme
deleteList readme
exportContacts readme
loadCampaign readme
loadCampaigns readme
loadCampaignsStats readme
loadChannelsStats readme
loadList readme
loadStatistics readme
loadTemplate readme
sendBulkEmails readme
sendTransactionalEmails readme
updateCampaign readme

API Endpoints

All URIs are relative to https://api.elasticemail.com/v4

Class Method HTTP request Description
CampaignsApi campaignsByNameDelete DELETE /campaigns/{name} Delete Campaign
CampaignsApi campaignsByNameGet GET /campaigns/{name} Load Campaign
CampaignsApi campaignsByNamePut PUT /campaigns/{name} Update Campaign
CampaignsApi campaignsGet GET /campaigns Load Campaigns
CampaignsApi campaignsPost POST /campaigns Add Campaign
ContactsApi contactsByEmailDelete DELETE /contacts/{email} Delete Contact
ContactsApi contactsByEmailGet GET /contacts/{email} Load Contact
ContactsApi contactsByEmailPut PUT /contacts/{email} Update Contact
ContactsApi contactsDeletePost POST /contacts/delete Delete Contacts Bulk
ContactsApi contactsExportByIdStatusGet GET /contacts/export/{id}/status Check Export Status
ContactsApi contactsExportPost POST /contacts/export Export Contacts
ContactsApi contactsGet GET /contacts Load Contacts
ContactsApi contactsImportPost POST /contacts/import Upload Contacts
ContactsApi contactsPost POST /contacts Add Contact
EmailsApi emailsByMsgidViewGet GET /emails/{msgid}/view View Email
EmailsApi emailsMergefilePost POST /emails/mergefile Send Bulk Emails CSV
EmailsApi emailsPost POST /emails Send Bulk Emails
EmailsApi emailsTransactionalPost POST /emails/transactional Send Transactional Email
EventsApi eventsByTransactionidGet GET /events/{transactionid} Load Email Events
EventsApi eventsChannelsByNameExportPost POST /events/channels/{name}/export Export Channel Events
EventsApi eventsChannelsByNameGet GET /events/channels/{name} Load Channel Events
EventsApi eventsChannelsExportByIdStatusGet GET /events/channels/export/{id}/status Check Channel Export Status
EventsApi eventsExportByIdStatusGet GET /events/export/{id}/status Check Export Status
EventsApi eventsExportPost POST /events/export Export Events
EventsApi eventsGet GET /events Load Events
FilesApi filesByNameDelete DELETE /files/{name} Delete File
FilesApi filesByNameGet GET /files/{name} Download File
FilesApi filesByNameInfoGet GET /files/{name}/info Load File Details
FilesApi filesGet GET /files List Files
FilesApi filesPost POST /files Upload File
InboundRouteApi inboundrouteByIdDelete DELETE /inboundroute/{id} Delete Route
InboundRouteApi inboundrouteByIdGet GET /inboundroute/{id} Get Route
InboundRouteApi inboundrouteByIdPut PUT /inboundroute/{id} Update Route
InboundRouteApi inboundrouteGet GET /inboundroute Get Routes
InboundRouteApi inboundrouteOrderPut PUT /inboundroute/order Update Sorting
InboundRouteApi inboundroutePost POST /inboundroute Create Route
ListsApi listsByNameContactsPost POST /lists/{name}/contacts Add Contacts to List
ListsApi listsByNameContactsRemovePost POST /lists/{name}/contacts/remove Remove Contacts from List
ListsApi listsByNameDelete DELETE /lists/{name} Delete List
ListsApi listsByNameGet GET /lists/{name} Load List
ListsApi listsByNamePut PUT /lists/{name} Update List
ListsApi listsGet GET /lists Load Lists
ListsApi listsPost POST /lists Add List
SecurityApi securityApikeysByNameDelete DELETE /security/apikeys/{name} Delete ApiKey
SecurityApi securityApikeysByNameGet GET /security/apikeys/{name} Load ApiKey
SecurityApi securityApikeysByNamePut PUT /security/apikeys/{name} Update ApiKey
SecurityApi securityApikeysGet GET /security/apikeys List ApiKeys
SecurityApi securityApikeysPost POST /security/apikeys Add ApiKey
SecurityApi securitySmtpByNameDelete DELETE /security/smtp/{name} Delete SMTP Credential
SecurityApi securitySmtpByNameGet GET /security/smtp/{name} Load SMTP Credential
SecurityApi securitySmtpByNamePut PUT /security/smtp/{name} Update SMTP Credential
SecurityApi securitySmtpGet GET /security/smtp List SMTP Credentials
SecurityApi securitySmtpPost POST /security/smtp Add SMTP Credential
SegmentsApi segmentsByNameDelete DELETE /segments/{name} Delete Segment
SegmentsApi segmentsByNameGet GET /segments/{name} Load Segment
SegmentsApi segmentsByNamePut PUT /segments/{name} Update Segment
SegmentsApi segmentsGet GET /segments Load Segments
SegmentsApi segmentsPost POST /segments Add Segment
StatisticsApi statisticsCampaignsByNameGet GET /statistics/campaigns/{name} Load Campaign Stats
StatisticsApi statisticsCampaignsGet GET /statistics/campaigns Load Campaigns Stats
StatisticsApi statisticsChannelsByNameGet GET /statistics/channels/{name} Load Channel Stats
StatisticsApi statisticsChannelsGet GET /statistics/channels Load Channels Stats
StatisticsApi statisticsGet GET /statistics Load Statistics
SubAccountsApi subaccountsByEmailCreditsPatch PATCH /subaccounts/{email}/credits Add, Subtract Email Credits
SubAccountsApi subaccountsByEmailDelete DELETE /subaccounts/{email} Delete SubAccount
SubAccountsApi subaccountsByEmailGet GET /subaccounts/{email} Load SubAccount
SubAccountsApi subaccountsByEmailSettingsEmailPut PUT /subaccounts/{email}/settings/email Update SubAccount Email Settings
SubAccountsApi subaccountsGet GET /subaccounts Load SubAccounts
SubAccountsApi subaccountsPost POST /subaccounts Add SubAccount
SuppressionsApi suppressionsBouncesGet GET /suppressions/bounces Get Bounce List
SuppressionsApi suppressionsBouncesImportPost POST /suppressions/bounces/import Add Bounces Async
SuppressionsApi suppressionsBouncesPost POST /suppressions/bounces Add Bounces
SuppressionsApi suppressionsByEmailDelete DELETE /suppressions/{email} Delete Suppression
SuppressionsApi suppressionsByEmailGet GET /suppressions/{email} Get Suppression
SuppressionsApi suppressionsComplaintsGet GET /suppressions/complaints Get Complaints List
SuppressionsApi suppressionsComplaintsImportPost POST /suppressions/complaints/import Add Complaints Async
SuppressionsApi suppressionsComplaintsPost POST /suppressions/complaints Add Complaints
SuppressionsApi suppressionsGet GET /suppressions Get Suppressions
SuppressionsApi suppressionsUnsubscribesGet GET /suppressions/unsubscribes Get Unsubscribes List
SuppressionsApi suppressionsUnsubscribesImportPost POST /suppressions/unsubscribes/import Add Unsubscribes Async
SuppressionsApi suppressionsUnsubscribesPost POST /suppressions/unsubscribes Add Unsubscribes
TemplatesApi templatesByNameDelete DELETE /templates/{name} Delete Template
TemplatesApi templatesByNameGet GET /templates/{name} Load Template
TemplatesApi templatesByNamePut PUT /templates/{name} Update Template
TemplatesApi templatesGet GET /templates Load Templates
TemplatesApi templatesPost POST /templates Add Template
VerificationsApi verificationsByEmailDelete DELETE /verifications/{email} Delete Email Verification Result
VerificationsApi verificationsByEmailGet GET /verifications/{email} Get Email Verification Result
VerificationsApi verificationsByEmailPost POST /verifications/{email} Verify Email
VerificationsApi verificationsFilesByIdDelete DELETE /verifications/files/{id} Delete File Verification Result
VerificationsApi verificationsFilesByIdResultDownloadGet GET /verifications/files/{id}/result/download Download File Verification Result
VerificationsApi verificationsFilesByIdResultGet GET /verifications/files/{id}/result Get Detailed File Verification Result
VerificationsApi verificationsFilesByIdVerificationPost POST /verifications/files/{id}/verification Start verification
VerificationsApi verificationsFilesPost POST /verifications/files Upload File with Emails
VerificationsApi verificationsFilesResultGet GET /verifications/files/result Get Files Verification Results
VerificationsApi verificationsGet GET /verifications Get Emails Verification Results

Models

Authorization

apikey

  • Type: API key
  • API key parameter name: X-ElasticEmail-ApiKey
  • Location: HTTP header

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

support@elasticemail.com

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 4.0.0
    • Package version: 4.0.23
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen