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.
Installs: 38 522
Dependents: 3
Suggesters: 0
Security: 0
Stars: 8
Watchers: 3
Forks: 10
Open Issues: 0
Requires
- php: ^7.3 || ^8.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^1.7 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.12
- phpunit/phpunit: ^8.0 || ^9.0
This package is auto-updated.
Last update: 2024-10-08 09:39:48 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
API Endpoints
All URIs are relative to https://api.elasticemail.com/v4
Models
- AccessLevel
- AccountStatusEnum
- ApiKey
- ApiKeyPayload
- BodyContentType
- BodyPart
- Campaign
- CampaignOptions
- CampaignRecipient
- CampaignStatus
- CampaignTemplate
- ChannelLogStatusSummary
- CompressionFormat
- ConsentData
- ConsentTracking
- Contact
- ContactActivity
- ContactPayload
- ContactSource
- ContactStatus
- ContactUpdatePayload
- ContactsList
- DeliveryOptimizationType
- EmailContent
- EmailData
- EmailJobFailedStatus
- EmailJobStatus
- EmailMessageData
- EmailPredictedValidationStatus
- EmailRecipient
- EmailSend
- EmailStatus
- EmailTransactionalMessageData
- EmailValidationResult
- EmailValidationStatus
- EmailView
- EmailsPayload
- EncodingType
- EventType
- EventsOrderBy
- ExportFileFormats
- ExportLink
- ExportStatus
- FileInfo
- FilePayload
- FileUploadResult
- InboundPayload
- InboundRoute
- InboundRouteActionType
- InboundRouteFilterType
- ListPayload
- ListUpdatePayload
- LogJobStatus
- LogStatusSummary
- MergeEmailPayload
- MessageAttachment
- MessageCategory
- NewApiKey
- NewSmtpCredentials
- Options
- RecipientEvent
- Segment
- SegmentPayload
- SmtpCredentials
- SmtpCredentialsPayload
- SortOrderItem
- SplitOptimizationType
- SplitOptions
- SubAccountInfo
- SubaccountEmailCreditsPayload
- SubaccountEmailSettings
- SubaccountEmailSettingsPayload
- SubaccountPayload
- SubaccountSettingsInfo
- SubaccountSettingsInfoPayload
- Suppression
- Template
- TemplatePayload
- TemplateScope
- TemplateType
- TransactionalRecipient
- Utm
- VerificationFileResult
- VerificationFileResultDetails
- VerificationStatus
Authorization
Authentication schemes defined for the API:
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
About this package
This PHP package is automatically generated by the OpenAPI Generator project:
- API version:
4.0.0
- Package version:
4.0.24
- Generator version:
7.7.0
- Package version:
- Build package:
org.openapitools.codegen.languages.PhpClientCodegen