Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Elasticemail Php Laravel Package

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.

View on GitHub
Deep Wiki
Context7

ElasticEmail\SegmentsApi

All URIs are relative to https://api.elasticemail.com/v4, except if the operation defines another base path.

Method HTTP request Description
segmentsByNameDelete() DELETE /segments/{name} Delete Segment
segmentsByNameGet() GET /segments/{name} Load Segment
segmentsByNamePut() PUT /segments/{name} Update Segment
segmentsGet() GET /segments Load Segments
segmentsPost() POST /segments Add Segment

segmentsByNameDelete()

segmentsByNameDelete($name)

Delete Segment

Delete an existing segment. Required Access Level: ModifyContacts

Example

<?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\SegmentsApi(
    // 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 = My Segment 1; // string | Name of your segment.

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

Parameters

Name Type Description Notes
name string Name of your segment.

Return type

void (empty response body)

Authorization

apikey

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

segmentsByNameGet()

segmentsByNameGet($name): \ElasticEmail\Model\Segment

Load Segment

Returns details for the specified segment. Required Access Level: ViewContacts

Example

<?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\SegmentsApi(
    // 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 the segment you want to load. Will load all contacts if the 'All Contacts' name has been provided

try {
    $result = $apiInstance->segmentsByNameGet($name);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SegmentsApi->segmentsByNameGet: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
name string Name of the segment you want to load. Will load all contacts if the 'All Contacts' name has been provided

Return type

\ElasticEmail\Model\Segment

Authorization

apikey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

segmentsByNamePut()

segmentsByNamePut($name, $segment_payload): \ElasticEmail\Model\Segment

Update Segment

Rename or change RULE for your segment. Required Access Level: ModifyContacts

Example

<?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\SegmentsApi(
    // 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 = My Segment 1; // string | Name of your segment.
$segment_payload = new \ElasticEmail\Model\SegmentPayload(); // \ElasticEmail\Model\SegmentPayload

try {
    $result = $apiInstance->segmentsByNamePut($name, $segment_payload);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SegmentsApi->segmentsByNamePut: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
name string Name of your segment.
segment_payload \ElasticEmail\Model\SegmentPayload

Return type

\ElasticEmail\Model\Segment

Authorization

apikey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

segmentsGet()

segmentsGet($limit, $offset): \ElasticEmail\Model\Segment[]

Load Segments

Returns a list of all your available Segments. Required Access Level: ViewContacts

Example

<?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\SegmentsApi(
    // 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->segmentsGet($limit, $offset);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SegmentsApi->segmentsGet: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
limit int Maximum number of returned items. [optional]
offset int How many items should be returned ahead. [optional]

Return type

\ElasticEmail\Model\Segment[]

Authorization

apikey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

segmentsPost()

segmentsPost($segment_payload): \ElasticEmail\Model\Segment

Add Segment

Add a new segment, based on specified RULE. Required Access Level: ModifyContacts

Example

<?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\SegmentsApi(
    // 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
);
$segment_payload = new \ElasticEmail\Model\SegmentPayload(); // \ElasticEmail\Model\SegmentPayload

try {
    $result = $apiInstance->segmentsPost($segment_payload);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SegmentsApi->segmentsPost: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
segment_payload \ElasticEmail\Model\SegmentPayload

Return type

\ElasticEmail\Model\Segment

Authorization

apikey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky