The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Google::Adwords::ReportService - Interact with the Google Adwords ReportService API calls

VERSION

This documentation refers to Google::Adwords::ReportService version 0.0.1

SYNOPSIS

    use Google::Adwords::ReportService;

    # create the report service object
    my $report_service = Google::Adwords::ReportService->new();

    # need to login to the Adwords service
    $report_service->email($email_address)
                   ->password($password)
                   ->developerToken($developer_token)
                   ->applicationToken($app_token)
    ;

    # delete a report
    my $report_job_id = 123456;
    $report_service->deleteReport($report_job_id);

    # get all the jobs
    my @jobs = $report_service->getAllJobs();

    # get status for report job
    my $status = $report_service->getReportJobStatus($report_job_id);

    # get gzip url for download
    my $gzip_url = $report_service->getGzipReportDownloadUrl($report_job_id);
    
    # get url for download
    my $url = $report_service->getReportDownloadUrl($report_job_id);

    # schedule a report
    my $job = Google::Adwords::ReportJob->new
     ->startDay('2006-08-01')
     ->endDay('2006-08-01')
     ->name('Test report via API')
     ->aggregationType('Daily')
     ->adWordsType('SearchOnly');

    my $jobid = $report_service->scheduleReportJob('AccountReportJob', $job);

  

METHODS

deleteReport()

Description

    Deletes a report job along with the report it produced, if any. Cannot delete a report job in progress.

Usage

       my $ret = $obj->deleteReport($job_id);

Parameters

  • $job_id => The ID of the report job

Returns

    1 on success

getAllJobs()

Description

    Returns an array consisting of all jobs the user has scheduled.

Usage

        my @jobs = $obj->getAllJobs();

Parameters

None.

Returns

    A list of Google::Adwords::ReportJob objects

getGzipReportDownloadUrl()

Description

    Returns a URL from which a compressed report with the given job ID can be downloaded (in Gzip format). After invoking this method, the caller can do a regular HTTP GET on the returned URL to retrieve the report.

Usage

        my $url = $obj->getGzipReportDownloadUrl($job_id);

Parameters

  • $job_id => The ID of the report job

Returns

  • $url => A URL from which the compressed report can be downloaded

getReportDownloadUrl()

Description

    Returns a URL from which the report with the given job ID can be downloaded. After invoking this method, the caller can do a regular HTTP GET on the returned URL to retrieve the report.

Usage

        my $url = $obj->getReportDownloadUrl($job_id);

Parameters

  • $job_id => The ID of the report job

Returns

  • $url => A URL from which the report can be downloaded

getReportJobStatus()

Description

    Returns the status of the report job with the given reportJobId. One of: { Pending | InProgress | Completed | Failed }

Usage

        my $status = $obj->getReportJobStatus($job_id);

Parameters

  • $job_id => The ID of the report job

Returns

  • $status => The report job status

scheduleReportJob()

Description

    Schedules a report job for execution.

Usage

        my $job_id = $obj->scheduleReportJob($type, $job);

Parameters

1) $type => The type of the Report Job. Should be one of:

    * CustomReportJob - http://www.google.com/apis/adwords/developer/CustomReportJob.html

    * UrlReportJob - http://www.google.com/apis/adwords/developer/UrlReportJob.html

    * KeywordReportJob - http://www.google.com/apis/adwords/developer/KeywordReportJob.html

    * AdTextReportJob - http://www.google.com/apis/adwords/developer/AdTextReportJob.html

    * AdImageReportJob - http://www.google.com/apis/adwords/developer/AdImageReportJob.html

    * AdGroupReportJob - http://www.google.com/apis/adwords/developer/AdGroupReportJob.html

    * CampaignReportJob - http://www.google.com/apis/adwords/developer/CampaignReportJob.html

    * AccountReportJob - http://www.google.com/apis/adwords/developer/AccountReportJob.html

2) $job => A Google::Adwords::ReportJob object

Returns

  • $job_id => The Report Job ID

SEE ALSO

AUTHORS

Rohan Almeida <rohan@almeida.in>

Mathieu Jondet <mathieu@eulerian.com>

LICENCE AND COPYRIGHT

Copyright (c) 2006 Rohan Almeida <rohan@almeida.in>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.