• Stars
    star
    113
  • Rank 310,115 (Top 7 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 12 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ActiveCampaign PHP API Wrapper

This is the official PHP wrapper for the ActiveCampaign API. The purpose of these files is to provide a simple interface to the ActiveCampaign API. You are not required to use these files (in order to use the ActiveCampaign API), but it's recommended for a few reasons:

  1. It's a lot easier to get set up and use (as opposed to coding everything from scratch on your own).
  2. It's fully supported by ActiveCampaign, meaning we fix any issues immediately, as well as continually improve the wrapper as the software changes and evolves.
  3. It's often the standard approach for demonstrating API requests when using ActiveCampaign support.

Both customers of our hosted platform and On-Site edition can use these files. On-Site customers should clone the source and switch to the "onsite" branch, as that is geared towards the On-Site edition. Many features of the hosted platform are not available in the On-Site edition.

Installation

You can install activecampaign-api-php by downloading (.zip) or cloning the source:

git clone [email protected]:ActiveCampaign/activecampaign-api-php.git

Composer

If you are using Composer, create your composer.json file (example here).

Then load the composer.phar file in that directory:

curl -sS https://getcomposer.org/installer | php

Next, run install to load the ActiveCampaign library:

php composer.phar install

You should then see the activecampaign folder inside vendor.

Read more about using Composer.

Example Usage

Composer

In your script just include the autoload.php file to load all classes:

require "vendor/autoload.php";

Next, create a class instance of ActiveCampaign:

$ac = new ActiveCampaign("API_URL", "API_KEY");

That's it!

includes/config.php

define("ACTIVECAMPAIGN_URL", "API_URL");
define("ACTIVECAMPAIGN_API_KEY", "API_KEY");

examples.php

require_once("includes/ActiveCampaign.class.php");

$ac = new ActiveCampaign(ACTIVECAMPAIGN_URL, ACTIVECAMPAIGN_API_KEY);

// Adjust the default cURL timeout
$ac->set_curl_timeout(10);

$account = $ac->api("account/view");

Or just include everything in the same PHP file:

define("ACTIVECAMPAIGN_URL", "API_URL");
define("ACTIVECAMPAIGN_API_KEY", "API_KEY");
require_once("includes/ActiveCampaign.class.php");
$ac = new ActiveCampaign(ACTIVECAMPAIGN_URL, ACTIVECAMPAIGN_API_KEY);

// Adjust the default cURL timeout
$ac->set_curl_timeout(10);

$account = $ac->api("account/view");

See our examples file for more in-depth samples.

Full Documentation

Click here to view our full API documentation.

Reporting Issues

We'd love to help if you have questions or problems. Report issues using the Github Issue Tracker or email [email protected].

More Repositories

1

postmark-templates

Rock-solid transactional email templates for applications.
HTML
2,836
star
2

mailmason

A complete toolset to streamline building and updating a set of consistent transactional emails.
Handlebars
912
star
3

postmark-rails

Official integration library for using Rails and ActionMailer with the Postmark HTTP API
Ruby
340
star
4

postmark.js

Official Node.js library for the Postmark API
TypeScript
294
star
5

mustachio

Lightweight, powerful, flavorful, template engine.
C#
198
star
6

postmark-gem

Official Ruby client library for the Postmark HTTP API
Ruby
197
star
7

postmark-php

The official PHP library for Postmark.
PHP
155
star
8

PactMaker

Starter workflow for creating electronically signed PDF agreements.
EJS
132
star
9

postmark-cli

The official CLI tool for Postmark
TypeScript
74
star
10

style-merge

Simple CSS inlining, for email.
C#
68
star
11

swiftmailer-postmark

The Official Swiftmailer Transport for Postmark.
PHP
53
star
12

mailhandler

Simple lightweight mail library which allows you to send and retrieve emails, and get more details about email sending and delivery
Ruby
53
star
13

postmark-dotnet

A .NET library for the Postmark API
C#
47
star
14

smtp-field-manual

A collection of raw STMP server responses from major email service providers and spam filter services.
JavaScript
44
star
15

activecampaign-api-nodejs

Node.js wrapper for the ActiveCampaign API
JavaScript
39
star
16

postmark-java

Official Java client library for the Postmark HTTP API
Java
36
star
17

mailbrush

Node.js library for generating email friendly snippets with syntax highlighting
JavaScript
33
star
18

laravel-postmark-provider

A Postmark adapter for Laravel 5+
PHP
30
star
19

postmark_webhooks

Lightweight quickstart app for receiving and processing webhooks from Postmark
JavaScript
29
star
20

postmark-wordpress

The Official Postmark Wordpress Plugin
PHP
19
star
21

postmark-nodemailer

Using Postmark to send transactional emails through nodemailer
JavaScript
17
star
22

postmark-firebase

Postmark + Firebase + Cloud Functions Tutorial
HTML
15
star
23

craft3-donottrack

Craft 3 plugin for respecting Do Not Track headers sent by browsers.
PHP
13
star
24

module-integration

PHP
8
star
25

camp-css

CSS behind the distinctive style of ActiveCampaign
CSS
7
star
26

example-subscription_form_embed

ActiveCampaign Subscription Form API Script: Embed and customize your forms on any site.
PHP
6
star
27

example-sso_embed

Use SSO to link users to ActiveCampaign (bypassing the login), or embed as an iFrame.
PHP
6
star
28

postmark-coldfusion

ColdFusion library for sending emails through Postmark - http://postmarkapp.com
ColdFusion
5
star
29

app-wordpress

The official ActiveCampaign WordPress plugin
PHP
5
star
30

fakemail

Ruby
3
star
31

example-reseller_account_manage

ActiveCampaign Reseller Account Custom API Script: Add account, template, generate log-in link, and more.
PHP
3
star
32

ac-google-sheets-app-scripts

ActiveCampaign apps scripts to add helper functions to google sheets.
3
star
33

example-rest_hooks

Interact and manage ActiveCampaign webhooks via our REST API.
PHP
3
star
34

fakebounce

bounce generating tool
Ruby
3
star
35

example-add_subscriber_send_instant

Add a subscriber and trigger instant responders to send.
PHP
3
star
36

inbound-demo-rails

Demo showing how to use Postmark’s inbound email processing in a Rails app.
Ruby
3
star
37

aws-ssh-helper

Generates SSH configuration from EC2 metadata
PHP
3
star
38

example-recent_campaigns_rss

Recent Campaigns formatted as RSS.
PHP
2
star
39

camp-ui

Camp UI is the main source of Sketch files for our ActiveCampaign product design system.
2
star
40

camp-site

Vue
2
star
41

stylelint-config-activecampaign

Stylelint configuration used by ActiveCampaign
JavaScript
2
star
42

qa-configurator

simple configuration tool
Ruby
2
star
43

php56-apache-browsers-with-extensions

Dockerfile
1
star
44

ac-style-guide

Style Guide for ActiveCampaign
CSS
1
star
45

example-view_contact_details

View a contact's details including list subscriptions, custom field data, recent actions, and campaign history
PHP
1
star
46

ember-route-action-helper

JavaScript
1
star
47

vcard

PHP
1
star
48

craft-customerio

Craft CMS plugin for pushing newsletter subscribers to Customer.io
PHP
1
star
49

grunt-postmark

Send emails through Postmark using GruntJS.
HTML
1
star