Class AdWordInfoService

Description

AdWords Lib Info Service Class

Use this class to work with Google AdWords Info Service. The Info Service allows customers to obtain some basic information about their API usage

Located in /services/AdWordInfoService.inc

AdWordService
   |
   --AdWordInfoService
Method Summary
 AdWordInfoService AdWordInfoService (string $soapToolkit)
 int|false getFreeUsageQuotaThisMonth ([string $clientEmail = ''])
 int|false getMethodCost (string $service, string $method, string $date, [string $clientEmail = ''])
 int|false getOperationCount (string $startDate, string $endDate, [string $clientEmail = ''])
 int|false getOperationsQuotaThisMonth ([string $clientEmail = ''])
 int|false getUnitCount (string $startDate, string $endDate, [string $clientEmail = ''])
 array|false getUnitCountForClients (string $clientEmails, string $startDate, string $endDate, [string $clientEmail = ''])
 int|false getUnitCountForMethod (string $service, string $method, string $startDate, string $endDate, [string $clientEmail = ''])
 int|false getUsageQuotaThisMonth ([string $clientEmail = ''])
Methods

AdWordInfoService Constructor. It takes one parameter - name of a supported by AdWords Lib SOAP toolkit

Example:

  1.  <?php
  2.  ?>
Please use defined constants for supported by AdWords Lib toolkit names

AdWordInfoService AdWordInfoService (string $soapToolkit)
  • string $soapToolkit: name of a supported by AdWords Lib SOAP Toolkit

Designed specifically for AdWords Commercial Developer Program participants.

Retrieves this month's free usage quota for the developer token being used to make this call. For those not enrolled in the AdWords Commercial Developer Program, this value will be identical to that returned for getUsageQuotaThisMonth.

Example:

  1.  <?php
  2.  $infoService->setAccount($myEmail$myPass$myUserAgent$myDeveloperToken$myApplicationToken);
  3.  $response $infoService->getFreeUsageQuotaThisMonth();
  4.  if ($response === false// if an error appears
  5.          $errr $infoService->getLastError()//get error object
  6.          echo $errr->toString()//output error
  7.          exit();
  8.  }
  9.  ?>

int|false getFreeUsageQuotaThisMonth ([string $clientEmail = ''])
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Retrieves the cost, in quota units per operation, of the given method on a specific date.

Methods default to a cost of 1.

Example:

  1.  <?php
  2.  $infoService->setAccount($myEmail$myPass$myUserAgent$myDeveloperToken$myApplicationToken);
  3.  $service 'ReportService';
  4.  $method 'scheduleReportJob';
  5.  $date '2005-02-01T00:00:00Z';
  6.  $response $infoService->getMethodCost($service$method$date);
  7.  if ($response === false// if an error appears
  8.          $errr $infoService->getLastError()//get error object
  9.          echo $errr->toString()//output error
  10.          exit();
  11.  }
  12.  ?>

int|false getMethodCost (string $service, string $method, string $date, [string $clientEmail = ''])
  • string $service: The name of the service containing the method, for example, "ReportService".
  • string $method: The method whose quota cost is being queried, for example "scheduleReportJob".
  • string $date: The date for which to retrieve the cost of the method. An error occurs if this date is in the future.
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Retrieves the number of operations recorded for the developer token being used to make this call over a given period

Example:

  1.  <?php
  2.  $infoService->setAccount($myEmail$myPass$myUserAgent$myDeveloperToken$myApplicationToken);
  3.  $start '2005-01-01T00:00:00Z';
  4.  $end '2005-02-01T00:00:00Z';
  5.  $response $infoService->getOperationCount($start$end);
  6.  if ($response === false// if an error appears
  7.          $errr $infoService->getLastError()//get error object
  8.          echo $errr->toString()//output error
  9.          exit();
  10.  }
  11.  //$response is the number of operations recorded for the developer token
  12.  //being used to make this call over the given date range
  13.  ?>

int|false getOperationCount (string $startDate, string $endDate, [string $clientEmail = ''])
  • string $startDate: beginning of the period
  • string $endDate: end of the period
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Retrieves this month's operations quota for the developer token being used to make this call

Example:

  1.  <?php
  2.  $infoService->setAccount($myEmail$myPass$myUserAgent$myDeveloperToken$myApplicationToken);
  3.  $response $infoService->getOperationsQuotaThisMonth();
  4.  if ($response === false// if an error appears
  5.          $errr $infoService->getLastError()//get error object
  6.          echo $errr->toString()//output error
  7.          exit();
  8.  }
  9.  //$response is this month's operations quota for the developer token
  10.  //being used to make this call
  11.  ?>

int|false getOperationsQuotaThisMonth ([string $clientEmail = ''])
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Retrieves the number of quota units recorded for the developer token being used to make this call over the given date range.

The time zone is implicitly assumed to be Pacific time (PST or PDT). The given dates are inclusive; to get the unit count for a single day, supply it as both the start and end date. An error occurs if the startDate falls after the endDate or if either date is in the future.

Example:

  1.  <?php
  2.  $infoService->setAccount($myEmail$myPass$myUserAgent$myDeveloperToken$myApplicationToken);
  3.  $start '2005-01-01T00:00:00Z';
  4.  $end '2005-02-01T00:00:00Z';
  5.  $response $infoService->getUnitCount($start$end);
  6.  if ($response === false// if an error appears
  7.          $errr $infoService->getLastError()//get error object
  8.          echo $errr->toString()//output error
  9.          exit();
  10.  }
  11.  //$response is the number of operations recorded for the developer token
  12.  //being used to make this call over the given date range
  13.  ?>

int|false getUnitCount (string $startDate, string $endDate, [string $clientEmail = ''])
  • string $startDate: beginning of the period
  • string $endDate: end of the period
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Retrieves the number of quota units recorded for a subset of clients over the given date range.

The time zone is implicitly assumed to be Pacific time (PST or PDT). The given dates are inclusive; to get the unit count for a single day, supply it as both the start and end date. An error occurs if the startDate falls after the endDate or if either date is in the future.

Example:

  1.  <?php
  2.  $infoService->setAccount($myEmail$myPass$myUserAgent$myDeveloperToken$myApplicationToken);
  3.  $clientEmails array('john.doe@mail.com''jane.dean@mail.com');
  4.  $start '2006-01-01T00:00:00Z';
  5.  $end '2006-02-01T00:00:00Z';
  6.  $response $infoService->getUnitCountForClients($clientEmails$start$end);
  7.  if ($response === false// if an error appears
  8.          $errr $infoService->getLastError()//get error object
  9.          echo $errr->toString()//output error
  10.          exit();
  11.  }
  12.  ?>

array|false getUnitCountForClients (string $clientEmails, string $startDate, string $endDate, [string $clientEmail = ''])
  • string $clientEmails: list of login email used to identify the clients to retrieve quota units for. If the array is null or empty, this call will list the quota units for all clients.
  • string $startDate: the beginning of the date range, inclusive.
  • string $endDate: the end of the date range, inclusive.
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Retrieves the number of quota units recorded for the developer token being used to make this call over the given date range for a specific method.

The time zone is implicitly assumed to be Pacific time (PST or PDT). The given dates are inclusive; to get the unit count for a single day, supply it as both the start and end date. An error occurs if the startDate falls after the endDate or if either date is in the future.

Example:

  1.  <?php
  2.  $infoService->setAccount($myEmail$myPass$myUserAgent$myDeveloperToken$myApplicationToken);
  3.  $service 'ReportService';
  4.  $method 'scheduleReportJob';
  5.  $startDate '2005-02-01T00:00:00Z';
  6.  $endDate '2005-04-01T00:00:00Z';
  7.  $response $infoService->getUnitCountForMethod($service$method$startDate$endDate);
  8.  if ($response === false// if an error appears
  9.          $errr $infoService->getLastError()//get error object
  10.          echo $errr->toString()//output error
  11.          exit();
  12.  }
  13.  ?>

int|false getUnitCountForMethod (string $service, string $method, string $startDate, string $endDate, [string $clientEmail = ''])
  • string $service: The name of the service containing the method, for example, "ReportService".
  • string $method: The method whose quota cost is being queried, for example "scheduleReportJob".
  • string $startDate: The beginning of the date range, inclusive.
  • string $endDate: The end of the date range, inclusive.
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Retrieves this month's total usage quota, including free quota usage, or the developer token being used to make this call.

Example:

  1.  <?php
  2.  $infoService->setAccount($myEmail$myPass$myUserAgent$myDeveloperToken$myApplicationToken);
  3.  $response $infoService->getUsageQuotaThisMonth();
  4.  if ($response === false// if an error appears
  5.          $errr $infoService->getLastError()//get error object
  6.          echo $errr->toString()//output error
  7.          exit();
  8.  }
  9.  ?>

int|false getUsageQuotaThisMonth ([string $clientEmail = ''])
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Inherited Methods

Inherited From AdWordService

 AdWordService::AdWordService()
 AdWordService::callService()
 AdWordService::getAccount()
 AdWordService::getClientCustomerId()
 AdWordService::getClientEmail()
 AdWordService::getLastError()
 AdWordService::getResponseHeaders()
 AdWordService::setAccount()
 AdWordService::setClientCustomerId()
 AdWordService::setClientEmail()

Documentation generated on Mon, 10 Sep 2007 15:07:21 +0300 by phpDocumentor 1.3.2