* @package adCenter-PHP-API-Client
 * @subpackage Examples
 * @since 2010-12-20
 */
// Define where the adCenter API Client ./lib folder
define("ADCENTER_API_CLIENT_DIR", "/path/to/adCenter-PHP-API-Client/lib");
// Authentication details.
$username = "";
$password = "";
$developerToken = "";
// AdCenterUser class
require ADCENTER_API_CLIENT_DIR . "/AdCenterUser.php";
$user = new AdCenterUser($username, $password, $developerToken);
try {
    // Get the Administration Service
    $ReportingService = $user->GetReportingService();
    // Define the columns we want for the report
    $columns = array("AccountId", "TimePeriod", "Keyword", "Clicks", "Ctr", "AverageCpc", "Spend");
    // Create our Report Request
    $KeywordPerformanceReportRequest = new AdCenter_KeywordPerformanceReportRequest();
    $KeywordPerformanceReportRequest->Aggregation = AdCenter_ReportAggregation::Daily;
    $KeywordPerformanceReportRequest->Time = new AdCenter_ReportTime(null, null, AdCenter_ReportTimePeriod::Today);
    $KeywordPerformanceReportRequest->Columns = $columns;
    // Submit the Report Request and get back the ID
    $ReportRequestId = $ReportingService->SubmitGenerateReport($KeywordPerformanceReportRequest);
    var_dump($ReportRequestId);
    // Start the polling loop
    $waitSeconds = 3;
    // how long to wait (seconds) between each polling
    do {
        $pollAgain = false;