bytestgear / activecampaign
ActiveCampaign API connector for APIv3
Installs: 163
Dependents: 0
Suggesters: 0
Security: 0
Stars: 20
Watchers: 4
Forks: 18
Open Issues: 0
Type:package
Requires
- php: >=7.1.3
- ext-json: *
- guzzlehttp/guzzle: ^7.0.1
Requires (Dev)
- codedungeon/phpunit-result-printer: ^0.23.0
- friendsofphp/php-cs-fixer: ^2.11
- mockery/mockery: ~1.0
- phploc/phploc: ^4.0
- phpmd/phpmd: ^2.6
- phpunit/phpunit: ~7.0
- squizlabs/php_codesniffer: ^3.0
This package is auto-updated.
Last update: 2024-08-27 08:15:31 UTC
README
‼️ Important Notice: This package is no longer maintained. Feel free to fork the repository if you wish to continue development. Thank you for your support and understanding.
This package provides a PHP SDK for the ActiveCampaign API (v3).
It is inspired by the code style of Laravel's Forge SDK.
For more information on the ActiveCampaign API, refer to their developer documentation.
Table of Contents
Installation
This package can be installed through Composer:
$ composer require testmonitor/activecampaign
Make sure to use Composer's autoload:
require __DIR__.'/../vendor/autoload.php';
Start by creating a new instance:
$activeCampaign = new ActiveCampaign(ACTIVE_CAMPAIGN_URL, ACTIVE_CAMPAIGN_KEY);
Your API key can be found in your account on the Settings page under the "Developer" tab.
Upgrading
ActiveCampaign has announced that Organizations will be replaced by Accounts. As of version 4.0, this package will contain various changes to accommodate to this transition.
For this reason, some breaking changes had to be introduced. When you upgrade from 3.0 to 4.0, make sure to check any references to organizations (for example, in the createContact method) and replace them.
Usage
Once instantiated, you can simply call one of the methods provided by the SDK:
$activeCampaign->contacts();
This will provide you with a list of available contacts.
To create a contact, you can use the createContact
method:
$contact = $activeCampaign->createContact( 'johndoe@example.com', 'John', 'Doe', '1-541-754-3010' );
When the request was successful, $contact
will contain a Contact object with the contact details.
To retrieve an existing contact or create it when it is missing:
$contact = $activeCampaign->findOrCreateContact( 'johndoe@example.com', 'John', 'Doe' );
When the request was successful, $contact
will contain a Contact object with the contact details.
Tests
The package contains integration tests. You can run them using PHPUnit.
$ vendor/bin/phpunit
Changelog
Refer to CHANGELOG for more information.
Contributing
Refer to CONTRIBUTING for contributing details.
Credits
License
The MIT License (MIT). Refer to the License for more information.