Developers

Example Usage of
automation_contact_list

View contacts from an automation

Description: View all contacts that are part of a specific automation.
Endpoint: /admin/api.php?api_action=automation_contact_list
HTTP method: GET
Supported output formats: xml, json, serialize
Requires authentication: true
Parameters:
* indicates requirement. Underlined params include in URL, otherwise as part of the post body. POST data must be formatted as
Content-Type: application/x-www-form-urlencoded
. We don't accept any other input formats like JSON.
Variable Description
api_action*automation_contact_list
api_key*Your API key
api_outputxml, json, or serialize (default is XML)
automationThe ID of the automation you want to view contacts for
offsetOffset to start returning records from (default is 0)
limitLimit of records per page (default and maximum is 100)
nested_arrayWhen this is set to 1, information returned will have the result and the result message in separate arrays
Example response:
Variable Description
0Array
id4976
email[email protected]
automation_status1
adddate2014-04-07 13:33:54
remdate2014-04-07 13:33:54
lastblock7
lastdate2014-04-07 13:33:54
1Array
id532
email[email protected]
automation_status1
adddate2014-04-07 13:33:54
remdate2014-04-07 13:33:54
lastblock7
lastdate2014-04-07 13:33:54
result_code1
result_message2 Contact(s) found in this automation
result_outputserialize

PHP Example

This is an example of using the automation_contact_list call with PHP. You can replicate the same idea in virtually any other programming language. The example shown is using serialize as the output format. You can change that to XML or JSON if you would like.

<?php

// Set up an object instance using our PHP API wrapper.
define("ACTIVECAMPAIGN_URL", "https://{ACCOUNT}.api-us1.com");
define("ACTIVECAMPAIGN_API_KEY", "{API_KEY}");
require_once("../activecampaign-api-php/includes/ActiveCampaign.class.php");
$ac = new ActiveCampaign(ACTIVECAMPAIGN_URL, ACTIVECAMPAIGN_API_KEY);

$response = $ac->api("automation/contact/list?automation=3&offset=0&limit=50");

echo "<pre>";
print_r($response);
echo "</pre>";?>

Questions? Discuss this API call in our developer forum