Class awAccountService

Description

AdWords Lib Account Service Class

Use this class to work with Google AdWords Account Service. AccountService provides operations for accessing, modifying, and creating Accounts

Located in /services/AccountService.php

awService
   |
   --awAccountService
Method Summary
 awAccountService awAccountService ([boolean $useSandbox = false])
 object|false getAccountInfo ([string $clientEmail = ''])
 array|false getClientAccountInfos ([ $clientEmail = ''])
 array|false getClientAccounts ([ $clientEmail = ''])
 array getMccAlerts ([string $clientEmail = ''])
 bool updateAccountInfo (object awV13AccountInfo $accountInfo, [string $clientEmail = ''])
Methods

awAccountService Constructor

Example:

  1.  <?php
  2.  $accountService new awAccountService();
  3.  ?>

awAccountService awAccountService ([boolean $useSandbox = false])
  • boolean $useSandbox: should we use the sandbox

Return the AdWords account specified by the client account header.

Example:

  1.  <?php
  2.  $accountService new awAccountService();
  3.  $accountService->setAccount($myEmail$myPass$myUserAgent$myDeveloperToken$myApplicationToken);
  4.  $response $accountService->getAccountInfo();
  5.  ?>

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

Gets the client account information for managed clients of effective user If the effective user user has no client accounts, an empty array is returned.

The effective user is: * the user specified in the clientEmail header of the request if that header is provided * the user specified in the email header if the clientEmail header is not provided For more information about the clientEmail header, see the section Request Headers in the Introduction. In other words, you can use the getClientAccounts request to find the primary email addresses for your own clients, or for your client's clients. If an account has more than one email associated with it, getClientAccounts gets only the primary email for the account.

Example:

  1.  <?php
  2.  $accountService new awAccountService();
  3.  $accountService->setAccount($myEmail$myPass$myUserAgent$myDeveloperToken$myApplicationToken);
  4.  $response $accountService->getClientAccountInfos();
  5.  //$response is an array of objects of class <a href="../PHP_AdWords_API_Lib/awV13ClientAccountInfo.html">awV13ClientAccountInfo</a>
  6.  ?>

array|false getClientAccountInfos ([ $clientEmail = ''])
  • $clientEmail

Gets the primary email address for each account managed by the effective user.

If the effective user user has no client accounts, an empty array is returned. The effective user is: * the user specified in the clientEmail header of the request if that header is provided * the user specified in the email header if the clientEmail header is not provided For more information about the clientEmail header, see the section Request Headers in the Introduction. In other words, you can use the getClientAccounts request to find the primary email addresses for your own clients, or for your client's clients. If an account has more than one email associated with it, getClientAccounts gets only the primary email for the account.

Example:

  1.  <?php
  2.  $accountService new awAccountService();
  3.  $accountService->setAccount($myEmail$myPass$myUserAgent$myDeveloperToken$myApplicationToken);
  4.  $response $accountService->getClientAccounts();
  5.  //$response is an array of strings
  6.  ?>

array|false getClientAccounts ([ $clientEmail = ''])
  • $clientEmail

etrieves the MCC alerts associated with any of the accounts beneath the current account.

Example:

  1.  <?php
  2.  $accountService new awAccountService();
  3.  $accountService->setAccount($myEmail$myPass$myUserAgent$myDeveloperToken$myApplicationToken);
  4.  $response $accountService->getMccAlerts();
  5.  ?>

array getMccAlerts ([string $clientEmail = ''])
  • string $clientEmail: provide the clientEmail when you want to use a client's account rather than your own account

Updates the database to reflect the changes in the account object.

Example:

  1.  <?php
  2.  $accountService new awAccountService();
  3.  $accountService->setAccount($myEmail$myPass$myUserAgent$myDeveloperToken$myApplicationToken);
  4.  
  5.  $account new awV13AccountInfo;
  6.  $account->set('descriptiveName''Renamed Account');
  7.  $account->set('languagePreference''en');
  8.  
  9.  $response $accountService->updateAccountInfo($account);
  10.  ?>

bool updateAccountInfo (object awV13AccountInfo $accountInfo, [string $clientEmail = ''])
  • object awV13AccountInfo $accountInfo: the account info object to be updated
  • string $clientEmail: provide the clientEmail when you want to use a client's account rather than your own account

Inherited Methods

Inherited From awService

 awService::__construct()
 awService::callService()
 awService::checkArray()
 awService::checkArrayOf()
 awService::checkObjectOf()
 awService::getAccount()
 awService::getClientCustomerId()
 awService::getClientEmail()
 awService::getResponseHeaders()
 awService::getToolkit()
 awService::setAccount()
 awService::setClientCustomerId()
 awService::setClientEmail()
 awService::setTokens()
 awService::setUserAgent()
 awService::_getServiceHeadersV2009()
 awService::_returnResponseAsArrayOf()
 awService::_returnResponseAsObjectOf()

Documentation generated on Thu, 15 Apr 2010 19:06:05 +0300 by phpDocumentor 1.4.3