mailchimp / marketing
Requires
- php: >=7.2
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.4 || ^7.2
- guzzlehttp/psr7: ^1.7 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ~2.12
- phpunit/phpunit: ^7
- squizlabs/php_codesniffer: ~2.6
- dev-master
- 3.0.80
- 3.0.79
- 3.0.78
- 3.0.75
- 3.0.74
- 3.0.73
- 3.0.72
- 3.0.71
- 3.0.70
- 3.0.69
- 3.0.68
- 3.0.67
- 3.0.66
- 3.0.65
- 3.0.64
- 3.0.63
- 3.0.62
- 3.0.61
- 3.0.59
- 3.0.58
- 3.0.57
- 3.0.56
- 3.0.55
- 3.0.54
- 3.0.53
- 3.0.52
- 3.0.51
- 3.0.50
- 3.0.49
- 3.0.48
- 3.0.47
- 3.0.46
- 3.0.45
- 3.0.44
- 3.0.43
- 3.0.42
- 3.0.41
- 3.0.40
- 3.0.39
- 3.0.38
- 3.0.37
- 3.0.36
- 3.0.35
- 3.0.34
- 3.0.33
- 3.0.32
- 3.0.31
- 3.0.30
- 3.0.29
- 3.0.28
- 3.0.27
- 3.0.26
- 3.0.25
- 3.0.24
- 3.0.23
- 3.0.22
- dev-hm-test-change
- dev-add-license
This package is auto-updated.
Last update: 2024-11-30 02:18:53 UTC
README
Mailchimp Marketing — PHP
The official PHP client library for the Mailchimp Marketing API
Installation
Option 1: Install via Packagist
composer require mailchimp/marketing
Or add the following to composer.json
{
"require": {
"mailchimp/marketing": "*"
}
}
Install all composer dependencies using:
composer install
Option 2: Install Manually
Clone the repo
git clone git@github.com:mailchimp/mailchimp-marketing-php.git
In the client library project root, install all dependencies
composer install
Manually include vendor/autoload.php
in your implementation
require_once('/path/to/MailchimpMarketing/vendor/autoload.php');
Quick Start
Note that this SDK requires PHP 7.2 or above.
require_once('/path/to/MailchimpMarketing/vendor/autoload.php'); $mailchimp = new MailchimpMarketing\ApiClient(); $mailchimp->setConfig([ 'apiKey' => 'YOUR_API_KEY', 'server' => 'YOUR_SERVER_PREFIX' ]); $response = $mailchimp->ping->get(); print_r($response);
Authentication Methods
The client library can be configured to use either Basic Auth or OAuth2.
For either method, a server prefix should be passed in i.e. us19
, in order for the client to determine to appropriate host url.
Basic Auth
$mailchimp->setConfig([ 'apiKey' => 'YOUR_API_KEY', 'server' => 'YOUR_SERVER_PREFIX' ]);
OAuth2
$mailchimp->setConfig([ 'accessToken' => 'YOUR_ACCESS_TOKEN', 'server' => 'YOUR_SERVER_PREFIX' ]);
PRs and Issues
This repo is autogenerated from https://github.com/mailchimp/mailchimp-client-lib-codegen -- please submit PRs or issues there!
Other configuration options
The APIClient class lets you set various configuration options like timeouts, host, user agent, and debug output. See https://github.com/mailchimp/mailchimp-marketing-php/blob/master/lib/Configuration.php for more details.
API Endpoints
All URIs are relative to https://server.api.mailchimp.com/3.0
Additional Libraries
Mailchimp Marketing libraries are available in the following languages: