This document contains conceptual and procedural information on connecting your development environment or other systems to the ExactTarget web service API via PHP.
You can use the connection to the web service API to test your calls and perform various tasks, such as sending email and retrieving tracking information.
You must follow the requirements below to connect to the web service API via PHP.
The sample code below demonstrates how to connect and interact with the web service API.
The xmlseclibs project provides a lightweight PHP library for XML security.
Prerequesite:
/* Set include directory for exacttarget PHP SOAP library files.
The path to these files may already be set for the include_path
setting within the php.ini file */
$includeDir = realpath(dirname(__FILE__).'/../includes/');
$path = ini_get('include_path');
$path = $includeDir . PATH_SEPARATOR . $path;
ini_set('include_path', $path);
require('exacttarget_soap_client.php')
/* Set location of WSDL */
$wsdl = 'https://webservice.exacttarget.com/etframework.wsdl';
try {
/* Create the Soap Client */
@$client = new ExactTargetSoapClient($wsdl, array('trace'=>1));
/* Set username and password here */
$client->username = 'username';
$client->password = 'password';
/* Other Code Here */
} The attached file contains all of the object classes contained in the ExactTarget WSDL. Use the objects to review and prepare your API calls.
| File | Size | Date | Attached by | |||
|---|---|---|---|---|---|---|
| exacttarget_soap_client.php No description | 53.68 kB | 11:51, 18 May 2010 | Admin | Actions | ||
| soap-wsse.php No description | 10.66 kB | 19:58, 28 May 2010 | Admin | Actions | ||