Re: AuthenticationError.CLIENT_CUSTOMER_ID_IS_REQUIRED thrown at random

2017-11-28 Thread Agusti Bau
Hello Vincent, 
Most of the calls succeed... the client customer id relates to the final 
user right? Do I need my users to input it by hand?

El martes, 28 de noviembre de 2017, 8:54:50 (UTC), Vincent Racaza (AdWords 
API Team) escribió:
>
> Hi Agusti,
>
> The CLIENT_CUSTOMER_ID_IS_REQUIRED 
> 
>  error 
> means that you did not specify a clientCustomerId in your request. Based on 
> your code, it seems that you are not using the property file in setting the 
> OAuth2 credentials. With this, please set the clientCustomerId this way:
>
> Credential oAuth2Credential = new OfflineCredentials.Builder()
> .forApi(Api.ADWORDS)
> .withClientSecrets("XXX", "XXX")
> .withRefreshToken("")
> .build()
> .generateCredential();
>
> // Construct an AdWordsSession.
> AdWordsSession session = new AdWordsSession.Builder()
> .withDeveloperToken("X")
> *.withClientCustomerId("XXX-XXX-")*
> .withOAuth2Credential(oAuth2Credential)
> .build();
>
> Let me know if this helps.
>
> Thanks,
> Vincent
> 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/ae695b7d-8168-4c56-b39e-8f3e2cbc8e25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


AuthenticationError.CLIENT_CUSTOMER_ID_IS_REQUIRED thrown at random

2017-11-27 Thread Agusti Bau
Hello guys, 

I'm developing an integration with you guys, basically the functionality I 
want to achieve is that my clients use my tool to add users to their 
remarketing lists.

To do that I've implemented the oauth flow and registered for the google 
api.

I'm storing the clientId, clientSecret and Adwords developer token (test 
for now), in my server, and then storing refresh tokens for each user who 
go through the oauth flow.

When i need some data from Google Apis, I run the code at the end of the 
post and then get the services needed.

Most of the times I get correct responses, but some times I get 
AuthenticationError.CLIENT_CUSTOMER_ID_IS_REQUIRED, like this one:

http://schemas.xmlsoap.org/soap/envelope/;>

https://adwords.google.com/api/adwords/cm/v201710; 
xmlns:ns2="https://adwords.google.com/api/adwords/rm/v201710;>
00055ef91cc02b680a81118635009f51
AdwordsUserListService
get
1
48




soap:Server
[AuthenticationError.CLIENT_CUSTOMER_ID_IS_REQUIRED @ ; 
trigger:'null']

https://adwords.google.com/api/adwords/cm/v201710; 
xmlns:ns2="https://adwords.google.com/api/adwords/rm/v201710;>
[AuthenticationError.CLIENT_CUSTOMER_ID_IS_REQUIRED @ ; 
trigger:'null']
ApiException
http://www.w3.org/2001/XMLSchema-instance; 
xsi:type="AuthenticationError">

null
AuthenticationError.CLIENT_CUSTOMER_ID_IS_REQUIRED
AuthenticationError
CLIENT_CUSTOMER_ID_IS_REQUIRED







private AdWordsSession initSession(String refreshToken) throws 
ValidationException, OAuthException {
Credential credential = new OfflineCredentials.Builder()
.forApi(OfflineCredentials.Api.ADWORDS)
.withClientSecrets(clientId, clientSecret)
.withRefreshToken(refreshToken)

.build()
.generateCredential();

// Create a new AdWordsSession without using a properties file.
return new AdWordsSession.Builder()
.withDeveloperToken(developerToken)
.withOAuth2Credential(credential)
.build();
}








Any help will 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/a34f1b16-140b-4748-a2a9-f8a69deca39a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.