Need to find the correct PHP code to connect API with MCC account and specify the custumer_id

24 views
Skip to first unread message

Laurent Adcom

unread,
Apr 24, 2015, 10:06:21 AM4/24/15
to adwor...@googlegroups.com
Hello Support Team,

I need your help ! I spend lot's of time to find an answer in your documentation. But i don't find ...

Since 6 month everything was OK and work perfectly to make our reporting with the API.
But since few day the version 201406 of the API had been stopped ...

I need to upgrade to 201502 to restart the service but I have a bug to connect to the Adwords API.

We have a MCC account, so we need to specifie the client id to make reporting for this customer.
My AdWordsUser.php is OK (with all token and keys) 

In the version v201406 of DownloadCriteriaReportWithAwql.php the part of the code to connect to each of our client was : 

  $user = new AdWordsUser(NULL, NULL, NULL, NULL,
       NULL, NULL, "$customerId");


And it was working until few day ...

But i don't find the correct code to do that with the v201502. I try to use this one but it doesn't work.

In the DownloadCriteriaReportWithAwql.php file :
 
  $user = new AdWordsUser();
  
  $user->SetClientId('9898849761');
  
   $user->SetOAuth2Info(array(
            "client_id" => "xxxxxxxxxxxxxx",
            "client_secret" => "Txxxxxxx",
            "access_token" => "xxxxxxxxxxxx",
        ));

If i do : 
$ php DownloadCriteriaReportWithAwql.php
An error has occurred: The client customer ID must be specified for report downloads.

Could you help me to find the correct code to connect to each clients with our MCC accound ??  
If you need more information, tell me !!

Regards,

Thierry GALLAY
IT manager / DATA / Webanalytics / Google API / R&D
Reply all
Reply to author
Forward
0 new messages