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
- ✅ 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
https://tinyurl.com/ynktjzhz https://tinyurl.com/yq5mne3j
app/
├── Http/
│ └── Controllers/
│ └── InfusionsoftController.php
│ └── ActivecampaignController.php
├── Models/
│ └── InfusionsoftToken.php
├── Services/
│ └── InfusionsoftService.php
│ └── ActiveCampaignService.php
resources/
└── views/
└── contacts.blade.php
- Clone the Repository
git clone https://github.com/umr4ever/laravel-infusionsoft-oauth-demo.git
cd laravel-infusionsoft-oauth-demo
- Install Dependencies
composer install
cp .env.example .env
php artisan key:generate
- 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
- Configure Database
Set your local DB connection in .env
, then run:
php artisan migrate
- Run the Application
php artisan serve
- Authorize App
Visit this URL to start OAuth2 flow:
http://127.0.0.1:8000/oauth/authorize
- Fetch Contacts
After authorization, access:
http://127.0.0.1:8000/contacts
- 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
👋 Mohammad Umair
Senior Laravel Developer | 15+ Years of Experience
Remote from 🇮🇳 | Seeking full-time remote roles
🔗 LinkedIn | 🔗 GitHub
This project is open-sourced under the MIT license.