Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplay error with invalid google adwords account
    text
    copied!<p>Im new to <a href="http://www.google.com/adwords/myclientcenter/" rel="nofollow">Google adwords - My client center</a>. I have a website to view all the MCC Campaigns, Adgroups, ads etc with Yii framework. It is working fine.</p> <p>My problem is, if the Mcc Email or Password or Client Id is invalid, it show the error like the below code. </p> <pre><code>Failed to get authToken. Reason: BadAuthentication $response = $this-&gt;Login(); 095 $fields = $this-&gt;ParseResponse($response); 096 if (array_key_exists('Error', $fields)) { 097 $error = $fields['Error']; 098 if (array_key_exists('Info', $fields)) { 099 $error .= ': ' . $fields['Info']; 100 } 101 $url = array_key_exists('Url', $fields) ? $fields['Url'] : NULL; 102 $captchaToken = array_key_exists('CaptchaToken', $fields) ? 103 $fields['CaptchaToken'] : NULL; 104 $captchaUrl = array_key_exists('CaptchaUrl', $fields) ? 105 $fields['CaptchaUrl'] : NULL; 106 throw new AuthTokenException($error, $url, $captchaToken, $captchaUrl); 107 } else if (!array_key_exists('Auth', $fields)) { 108 throw new AuthTokenException('Unknown'); 109 } else { 110 return $fields['Auth']; 111 } 112 } 113 114 /** 115 * Makes the client login request and stores the result. 116 * @return string the response from the ClientLogin API 117 * @throws AuthTokenException if an error occurs during authentication 118 */ </code></pre> <p>But i want display the error as "Your Account is invalid". Please advice where i can write the condition to check the account is valid. </p> <p>Im not having much idea about this. I searched for the google adwords api client library and found the following "<a href="http://code.google.com/p/google-api-adwords-php/downloads/list" rel="nofollow">http://code.google.com/p/google-api-adwords-php/downloads/list</a>". After that, downloaded the aw_api_php_lib_3.2.2.tar.gz and placed that code in "mysite/protected/" folder. And i have modified configuration in "mysite/protected/adwords/src/Google/Api/Ads/AdWords/auth.ini" file.</p> <p>In views file [mysite/protected/views/site/view.php], i have called the Adwords function as,</p> <pre><code>Yii::import('application.adwords.*'); require_once('examples/v201206/BasicOperations/GetCampaigns.php') $user = new AdWordsUser(); $user-&gt;LogAll(); $result_camp = GetCampaignsExample($user); </code></pre> <p>It returns all campaigns. But if i provided the wrong configuration details, it shows the above error [Failed to get authToken. Reason: BadAuthentication]. I want to display the error in specified format. Please advice. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload