<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sergey-demidov / mailerlite-api-v2-php-sdk example snippets
$groupsApi = (new \MailerLiteApi\MailerLite('your-api-key'))->groups();
$newGroup = $groupsApi->create(['name' => 'New group']); // creates group and returns it
$allGroups = $groupsApi->get(); // returns array of groups
$groupId = 123;
$singleGroup = $groupsApi->find($groupId); // returns single item object
$subscribers = $groupsApi->getSubscribers($groupId); // get subscribers who belongs to selected group
$subscribers = $groupsApi->getSubscribers($groupId, 'unsubscribed'); // get unsubscribed subscribers who belongs to selected group
$mailerliteClient = new \MailerLiteApi\MailerLite('your-api-key');
$groupsApi = $mailerliteClient->groups();
$groups = $groupsApi->get(); // returns array of groups
$fieldsApi = $mailerliteClient->fields();
$fields = $fieldsApi->get(); // returns array of fields
$guzzle = new \GuzzleHttp\Client();
$guzzleClient = new \Http\Adapter\Guzzle6\Client($guzzle);
$mailerliteClient = new \MailerLiteApi\Mailerlite('your-api-key', $guzzleClient);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.