Re: ClientCustomerId returns empty on AdwordsUser object

2017-04-24 Thread 'Shwetha Vastrad (AdWords API Team)' via AdWords API Forum
Hi James, 

On September 12th, 2016, AdWords announced 
 that you can now use 
one Google login to access multiple AdWords accounts. With this change, you 
can associate up to 5 AdWords accounts with a single Google account. In 
this scenario, the getCustomers() 

 method 
will return all the AdWords accounts directly accessible by this Google 
account. If you have a single AdWords account associated with the OAuth2 
credentials, then the response will contain the details of that account 
alone. 

Regards,
Shwetha, AdWords API Team.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/7a05c5e8-a9fa-406c-a223-4de732a56713%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ClientCustomerId returns empty on AdwordsUser object

2017-04-24 Thread James Andrews
Hi Shwetha,

OK, so if I call getCustomers() with the oauth credentials the return is an 
array, but it sounds like you're saying that the array will only ever have 
1 node and that will be the customer associated with the oauth credentials. 
 If that's the case then I think i am set, please confirm that is the case.

The ManagedCustomerService is what we are doing now, so glad that hasn't 
changed.

Thanks,
James


On Tuesday, April 25, 2017 at 3:35:28 AM UTC+9, Shwetha Vastrad (AdWords 
API Team) wrote:
>
> Hi James, 
>
> Assuming you have the OAuth2 credentials of the user for whom you need to 
> retrieve the AdWords account details, you need to use 
> CustomerService.getCustomers() 
> 
>  method 
> without setting the clientCustomerId 
> 
>  header 
> along with the credentials generated. The response will contain the details 
> of all AdWords accounts associated with the authenticated Google account.
>
> Please note that you'll only be able to get the AdWords account which can 
> be directly accessible by this user. If the user has access to a manager 
> account and you would like to retrieve the client accounts linked to this 
> manager, you need to use ManagedCustomerService 
> 
>  as 
> shown in this example 
> 
> . 
>
> Regards,
> Shwetha, AdWords API Team.
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/700b3713-278b-4d6e-b61c-7604998d957a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ClientCustomerId returns empty on AdwordsUser object

2017-04-24 Thread 'Shwetha Vastrad (AdWords API Team)' via AdWords API Forum
Hi James, 

Assuming you have the OAuth2 credentials of the user for whom you need to 
retrieve the AdWords account details, you need to use 
CustomerService.getCustomers() 

 method 
without setting the clientCustomerId 

 header 
along with the credentials generated. The response will contain the details 
of all AdWords accounts associated with the authenticated Google account.

Please note that you'll only be able to get the AdWords account which can 
be directly accessible by this user. If the user has access to a manager 
account and you would like to retrieve the client accounts linked to this 
manager, you need to use ManagedCustomerService 

 as 
shown in this example 

. 

Regards,
Shwetha, AdWords API Team.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/9331df9d-f8fd-4f00-8980-5857769f34ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ClientCustomerId returns empty on AdwordsUser object

2017-04-24 Thread James Andrews
I hadn't seen the notice for update, so that's something I guess I need to 
work on.

The question is then, is there a way to get the customer information on the 
owner of the access token with the new api?

I'll explain why I need it.  We don't and never have used an INI file.  We 
pull data for many clients.  They log into our website and create what we 
call a "remote identity"  which is basically a collection of  tokens for 
various APIs (Google, Adwords, Facebook, Instagram) etc...  

Part of the primary table for remote identities we store the remote api's 
userId, and identifying name so when customer goes to use their remote 
identity on one of our products they can easily select the right one and 
then when they can choose what adwords "customer" they want to associate 
with their order from that remote identity.  If we can't get access to this 
data then it means our process which was written generically to accommodate 
all oauth APIs now needs to be hacked for the special case of adwords.

Thanks,
James


On Tuesday, April 25, 2017 at 12:01:02 AM UTC+9, Shwetha Vastrad (AdWords 
API Team) wrote:
>
> Hi James, 
>
> If you haven't set the clientCustomerId in your auth.ini file, then you'll 
> not be able to retrieve it from the AdWordsUser object. To use the 
> CustomerService to retrieve the AdWords account associated with the 
> authenticated user, you need to use the getCustomers 
> 
>  method 
> as shown here 
> .
>  
> If the authenticated user is linked to just one AdWords account, then the 
> response will contain the details of that customer. If a clientCustomerId 
> is specified in the request header, only details of that customer will be 
> returned. If no clientCustomerId is specified in a request, the response 
> will contain multiple entries if more than one account is directly 
> accessible by the authenticated user. 
>
> On another note, in December 2016, we announced 
> 
>  the 
> stable release of the new ads PHP library and the deprecation of the old 
> one. The new PHP library has many improvements such as support of 
> namespaces and Composer  installation. The 
> AdwordsUser 
> 
>  which 
> was used to configure the AdWords settings is now replaced by the 
> AdWordsSessionBuilder 
> .
>  
> Please see the upgrading guide 
>  for 
> more details. 
>
> Regards,
> Shwetha, AdWords API Team.
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/0a1edf19-46b9-42c2-8907-659080329e5f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ClientCustomerId returns empty on AdwordsUser object

2017-04-24 Thread 'Shwetha Vastrad (AdWords API Team)' via AdWords API Forum
Hi James, 

If you haven't set the clientCustomerId in your auth.ini file, then you'll 
not be able to retrieve it from the AdWordsUser object. To use the 
CustomerService to retrieve the AdWords account associated with the 
authenticated user, you need to use the getCustomers 

 method 
as shown here 
.
 
If the authenticated user is linked to just one AdWords account, then the 
response will contain the details of that customer. If a clientCustomerId 
is specified in the request header, only details of that customer will be 
returned. If no clientCustomerId is specified in a request, the response 
will contain multiple entries if more than one account is directly 
accessible by the authenticated user. 

On another note, in December 2016, we announced 

 the 
stable release of the new ads PHP library and the deprecation of the old 
one. The new PHP library has many improvements such as support of 
namespaces and Composer  installation. The 
AdwordsUser 

 which 
was used to configure the AdWords settings is now replaced by the 
AdWordsSessionBuilder 
.
 
Please see the upgrading guide 
 for 
more details. 

Regards,
Shwetha, AdWords API Team.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/57bce676-8d2a-4fff-9259-857a7b7f2e77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ClientCustomerId returns empty on AdwordsUser object

2017-04-24 Thread James Andrews
I should point out that $this->user is an AdwordsUser object.

On Monday, April 24, 2017 at 10:00:21 PM UTC+9, James Andrews wrote:
>
> Last week I noticed that there was a change to the php Adwords API library.
>
> Previously when we authenticated a user I would use:
>
> $customerService = $this->user->GetService("CustomerService");
> $customer = $customerService->get();
>
> To get the customer associated with the user who granted us the oauth 
> token.  According to the link below that has changed.
>
>
> https://github.com/googleads/googleads-php-lib/blob/master/src/Google/AdsApi/AdWords/v201702/mcm/CustomerService.php#L83-L85
>
> I looked around and found the GetClientCustomerId object on the 
> AdwordsUser object.  However when I try to run it it returns as empty.  My 
> only thought is that if I list out all the customers I only have one, which 
> is correct, so I am wonder if this returns empty if there is only one 
> customer associated with the account.
>
> Any help on what I am doing wrong would be appreciated.
>
>
>
>
>
>
>
>
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/b7ac006a-7189-4b85-8041-a012cb3b6b17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ClientCustomerId returns empty on AdwordsUser object

2017-04-24 Thread James Andrews
Last week I noticed that there was a change to the php Adwords API library.

Previously when we authenticated a user I would use:

$customerService = $this->user->GetService("CustomerService");
$customer = $customerService->get();

To get the customer associated with the user who granted us the oauth 
token.  According to the link below that has changed.

https://github.com/googleads/googleads-php-lib/blob/master/src/Google/AdsApi/AdWords/v201702/mcm/CustomerService.php#L83-L85

I looked around and found the GetClientCustomerId object on the AdwordsUser 
object.  However when I try to run it it returns as empty.  My only thought 
is that if I list out all the customers I only have one, which is correct, 
so I am wonder if this returns empty if there is only one customer 
associated with the account.

Any help on what I am doing wrong would be appreciated.









-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/5bbb56a7-2b53-40ae-b1f4-f35b3c69a8b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.