ActiveCampaign Custom API Script: View a contact's details including list subscriptions, custom field data, recent actions, and campaign history.
This script is intended to get you going with our API by providing an interface to view contact data. You are free to customize the script to your liking.
- Our PHP API library
- A web server where you can run PHP code
You can install example-view_contact_details by downloading (or cloning) the source.
Input your ActiveCampaign URL and API Key at the top of the script. Example below:
$api_url = "https://ACCOUNT.api-us1.com"; $api_key = "4f3c6d12f0.....00ca273778dc893";
Also make sure the path to the PHP library is correct:
require_once("../../activecampaign-api-php/includes/ActiveCampaign.class.php");
Load the URL with the contact hash as a parameter (you can obtain the hash using the contact_view
API method):
http://mysite.com/view_contact_details/index.php?hash=[HASH]
We'd love to help if you have questions or problems. Report issues using the Github Issue Tracker or email help@activecampaign.com.