dynamically getting clientcustomerID after oauth 2.0 authorization

33 views
Skip to first unread message

NARESH SHAW

unread,
Dec 14, 2015, 8:58:24 AM12/14/15
to AdWords API Forum
Hi Team

I need urgent help and new to Adwords APi.

I am using Adword client library googleads php lib v201509 and In my auth.ini,I am not using any clientcustomerID as reference. I am using nAtive application and wanted to set dynamically clientCustomerID to access any services like CampaignService etc.

So before that I need to set $user->SetClientCustomerId($clientCustomerId); where $clientCustomerId = 'xxx-xxx-xxxx' ,so I want here clientcustomerID who just allowed permission for adwords application .

If i am assigning  $clientCustomerId = 'xxx-xxx-8979'  then for this account I can see details about service CampaignService but for other user its giving permission issue.

Even i use $customerService = $user->GetService('CustomerService', 'v201509');
        $selector = new Selector();
        $selector->fields = array('customerId');
        $page = $customerService->get($selector);
        var_dump($page); 

But its always giving me MCC account customerID whose details are given in auth.ini file. Please let me know any best solution, Waiting to hear from you soon.

Thanks
Naresh Shaw

Yin Niu

unread,
Dec 14, 2015, 11:51:34 AM12/14/15
to AdWords API Forum
Hi Naresh, 

Are you setting MCC account ID as clientCustomerID in the auth.ini? If yes, please comment the clientCustomerID line in auth.ini and set the clientCustomerID dynamically in your code. If no, then please provide me privately the SOAP XML request and response log. Just click Reply privately to author in the forum when responding. Don't forget to remove the developer token in the output.


Thanks,
Yin, AdWords API Team. 
Reply all
Reply to author
Forward
0 new messages