Vahid,

You should set the client customer ID - with 
$user->SetClientCustomerId(....).

Thanks,

Ray

On Tuesday, May 6, 2014 12:41:50 PM UTC-4, vahid seo wrote:
>
> I get an [AuthenticationError.CLIENT_CUSTOMER_ID_INVALID @ ; trigger:''] 
> exception when I execute the code below. I just want to get some info about 
> a word, in this case "books". What is wrong with the code? What's wrong 
> with my Google AdWords account?
>
> By the way, how many requests can I send per day? What do I have to do for 
> unlimited requests? Should I pay some money? Please help me.
>
> Thanks in advance.
>
> <?php
>
> $path = dirname( __FILE__ ) . PATH_SEPARATOR . "lib";
> set_include_path(get_include_path() . PATH_SEPARATOR . $path);
>
> require_once 'lib/Google/Api/Ads/AdWords/Lib/AdWordsUser.php';
> require_once 'lib/Google/Api/Ads/Common/Util/MapUtils.php';
>
>
> function getWord(AdWordsUser $user) {
>   // Get the service, which loads the required classes.
>   $targetingIdeaService = $user->GetTargetingIdeaService('v201402');
>
>   // Create seed keyword.
>   $keyword = 'Books';
>
>   // Create selector.
>   $selector = new TargetingIdeaSelector();
>   $selector->requestType = 'IDEAS';
>   //$selector->requestType = 'STATS';
>   $selector->ideaType = 'KEYWORD';
>   $selector->requestedAttributeTypes =
>       array('AVERAGE_CPC', 'COMPETITION', 'SEARCH_VOLUME', 
> 'TARGETED_MONTHLY_SEARCHES');
>
>   // Create related to keyword search parameter.
>   $selector->searchParameters[] =
>       new RelatedToQuerySearchParameter(array($keyword));
>
>   // Set selector paging (required by this service).
>   $selector->paging = new Paging(0, 
> AdWordsConstants::RECOMMENDED_PAGE_SIZE);
>
>   do {
>     // Make the get request.
>     $page = $targetingIdeaService->get($selector);
>
>     // Display results.
>     if (isset($page->entries)) {
>   print_r ( $page->entries );
>   
>     } else {
>       print "N/A";
>     }
>
>     // Advance the paging index.
>     $selector->paging->startIndex += 
> AdWordsConstants::RECOMMENDED_PAGE_SIZE;
>   } while ($page->totalNumEntries > $selector->paging->startIndex);
> }
>
>
> try {
>
> $oauth2Info = array(
> 'client_id' => "my_client_id",
> 'client_secret' => "my_client_secret",
> 'refresh_token' => 'my_refresh_token'
> );
>
>   $user = new AdWordsUser(NULL, 'my_email', 'my_password', 
> 'my_email++currency', 'my_token', 'user_agent', NULL, NULL, NULL, 
> $oauth2Info);
>
>   $user->SetClientId('xxx-xxx-xxxx');
>
>
>   // Run the example.
>   getWord($user);
> } catch (Exception $e) {
>   printf($e->getMessage());
> }
> ?>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to