Download the PHP package xdubois/activecampaign-api without Composer
On this page you can find all versions of the php package xdubois/activecampaign-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download xdubois/activecampaign-api
More information about xdubois/activecampaign-api
Files in xdubois/activecampaign-api
Package activecampaign-api
Short Description A PHP package for interacting with the ActiveCampaign API v3
License MIT
Homepage https://github.com/xdubois/activecampaign-api
Informations about the package activecampaign-api
ActiveCampaign API PHP Package
PHP SDK for the ActiveCampaign API v3: contacts, deals, accounts, custom objects, custom fields, tags, lists, webhooks and users.
Features
- Contacts (incl. tags, list subscriptions, automations, custom field values, bulk import/sync), deals (incl. pipelines, stages, tasks, custom fields), accounts (incl. contact associations, custom fields), custom objects, custom fields, tags, lists, webhooks and users
- Automatic retries with exponential backoff for rate limits (429), server errors (5xx) and network failures, honouring the
Retry-Afterheader - Typed exception hierarchy mapping HTTP status codes (401/403, 404, 422, 429) with the decoded error payload attached
- Works with Guzzle 7.9+ and Guzzle 8; the HTTP client can be injected, so the SDK is easy to mock in your own tests
- PHP 8.1+ with strict types, full type declarations and PHPStan level max
Requirements
- PHP 8.1 or higher
- Guzzle 7.9+ or 8.x (installed automatically)
- An ActiveCampaign account, its API URL and an API key (Settings > Developer)
Installation
Upgrading from 1.x? See the changelog for the (few) breaking changes.
Configuration
Basic setup
Always use the full API URL shown in your account's Developer settings: accounts outside the US use a different host than api-us1.com.
Advanced setup
The setters on Configuration (setTimeout(), setMaxRetries(), setDefaultHeaders(), ...) apply to every subsequent request.
Bring your own Guzzle client
Pass a pre-configured GuzzleHttp\ClientInterface as third argument to add middleware (logging, caching, ...) or to mock the API in your tests. All endpoints share that client.
Usage
Every method returns the decoded JSON response as an array and takes payloads in the exact shape documented by ActiveCampaign (including the top-level resource key such as contact, deal or account).
Contacts
Deals
Accounts, custom objects, custom fields, tags, lists, webhooks, users
Error handling
Rate limits (429) and server errors (5xx) are retried automatically up to maxRetries times; Retry-After headers are honoured.
Development
Contributing
Contributions are welcome. For major changes, please open an issue first to discuss what you would like to change, then submit a pull request.
License
MIT - see LICENSE.
Links
All versions of activecampaign-api with dependencies
ext-json Version *
guzzlehttp/guzzle Version ^7.9 || ^8.0
psr/http-client Version ^1.0
psr/http-message Version ^1.1 || ^2.0