Add Contacts To Your Account With A Status Transactional Via The API

About this task

Contacts who are not currently in the application can be added via the API with a status of transactional. This will permit the delivery of transactional emails to that contact, while preventing the delivery of marketing emails.


 * For use with API Version 4:
 * This script will add a contact with a status of transactional
 * @copyright  Copyright (c) 2011 Bronto Software (

$client = new SoapClient('',
                          array('trace' => 1,
								'features' => SOAP_SINGLE_ELEMENT_ARRAYS)

try {
	// Replace with a valid API token
	$token = "ADD API TOKEN HERE";

	print "logging in\n";
	$sessionId = $client->login(array('apiToken' => $token))->return;

	$session_header = new SoapHeader("",
									 array('sessionId' => $sessionId));

	// Replace the example email address with a valid email address
	$contacts = array('email' => '',
					'status' => 'transactional');

	print "adding contact with the following attributes\n";
	$contacts = $client->addContacts(array($contacts)

	// print added contact(s)
	foreach ($contacts as $contact) {

} catch (Exception $e) {
	print "uncaught exception\n";