Skip to content

umr4ever/laravel-infusionsoft-activecampaign-sync-demo

Repository files navigation

Laravel Infusionsoft to ActiveCampaign Sync Demo

This is a Laravel 12 demo project that demonstrates how to:

  • Authenticate with Infusionsoft (Keap) via OAuth2
  • Fetch contact details from Infusionsoft using REST API
  • Sync those contacts (and custom tags) into ActiveCampaign
  • Trigger sync via web routes for easy browser testing

🔧 Features

  • ✅ OAuth2 Authorization Flow with Infusionsoft
  • ✅ Token storage in database (access + refresh tokens)
  • ✅ Automatic token refresh if expired
  • ✅ Display real-time contacts from Infusionsoft on a Blade view
  • ✅ Laravel Service Class pattern used
  • ✅ Sync Infusionsoft contact into ActiveCampaign
  • ✅ Modular, clean code ready for production adaptation

📸 Screenshot

https://tinyurl.com/ynktjzhz https://tinyurl.com/yq5mne3j


🧱 Folder Structure

app/
├── Http/
│   └── Controllers/
│       └── InfusionsoftController.php
│       └── ActivecampaignController.php
├── Models/
│   └── InfusionsoftToken.php
├── Services/
│   └── InfusionsoftService.php
│   └── ActiveCampaignService.php
resources/
└── views/
    └── contacts.blade.php

🚀 Setup Instructions

  1. Clone the Repository
git clone https://github.com/umr4ever/laravel-infusionsoft-oauth-demo.git
cd laravel-infusionsoft-oauth-demo
  1. Install Dependencies
composer install
cp .env.example .env
php artisan key:generate
  1. Set Infusionsoft Credentials in .env
# Infusionsoft OAuth2 Credentials
INFUSIONSOFT_CLIENT_ID=your_client_id
INFUSIONSOFT_CLIENT_SECRET=your_client_secret
INFUSIONSOFT_REDIRECT_URI=http://127.0.0.1:8000/oauth/callback

# ActiveCampaign
ACTIVECAMPAIGN_URL=https://youraccount.api-us1.com
ACTIVECAMPAIGN_API_KEY=your_activecampaign_api_key
  1. Configure Database

Set your local DB connection in .env, then run:

php artisan migrate
  1. Run the Application
php artisan serve
  1. Authorize App

Visit this URL to start OAuth2 flow:

http://127.0.0.1:8000/oauth/authorize
  1. Fetch Contacts

After authorization, access:

http://127.0.0.1:8000/contacts
  1. Sync Contact to Active Campaign

Visit the test route in your browser:

http://127.0.0.1:8000/contact/sync/activecampaign?contactId=123
  • 123 should be a valid Infusionsoft contact ID
  • The app will:
    • Fetch contact info from Infusionsoft REST API
    • Sync to ActiveCampaign using the legacy API
    • Optionally, You can also use Add or remove AC tags

📦 API Used


🙋‍♂️ About the Author

👋 Mohammad Umair
Senior Laravel Developer | 15+ Years of Experience
Remote from 🇮🇳 | Seeking full-time remote roles
🔗 LinkedIn | 🔗 GitHub


📝 License

This project is open-sourced under the MIT license.

Releases

No releases published

Packages

No packages published

Languages