Hi Eric,
Thank you for your reply. It helped me track down the bug.
The adwords4r gem creates an empty 'clientEmail' entry in the
credentials hash whether you want it or not.
When I delete that entry from credentials when using
'clientCustomerId' everything works fine.
So this is what I do to fix the issue:
adwords = AdWords::API.new(AdWords::AdWordsCredentials.new(
{
"developerToken" => "*****",
"applicationToken" => "*****",
"useragent" => "*****",
"password" => "*****",
"email" => "*****",
"clientCustomerId" => "1234567890"
}))
report_service = adwords.get_service('ReportDefinition',
AdWords::Service.latest_version)
report_service.api.credentials.credentials.delete("clientEmail")
And it all works as expected.
Thank you.
Regards,
Abhinay Mehta
On Feb 8, 6:56 pm, AdWords API Advisor <[email protected]>
wrote:
> Hi,
>
> This error is coming from the report download service, which doesn't
> use the SOAP headers you showed. The code that sets the
> clientCustomerId header for report download is here:
>
> http://code.google.com/p/google-api-adwords-ruby/source/browse/trunk/...
>
> Can you ensure that you aren't setting an empty clientEmail value in
> your credentials? If you can't see any obvious problems with your
> configuration or this code then open a bug on the client library's
> issue tracker:
>
> http://code.google.com/p/google-api-adwords-ruby/issues/list
>
> Best,
> - Eric Koleda, AdWords API Team
>
> On Feb 4, 5:13 am, abhinay <[email protected]> wrote:
>
> > We're trying to generate a report for one of our non-mcc accounts
> > using the ruby gem adwords4r (version 19.4.0).
>
> > Here is the code:
>
> > adwords = AdWords::API.new(AdWords::AdWordsCredentials.new(
> > {
> > "developerToken" => "****",
> > "applicationToken" => "****",
> > "password" => "****",
> > "email" => "****",
> > "clientEmail" => [email protected]
> > }))
>
> > This works perfectly and we are able to download the report.
> > But when we try and use the 'clientCustomerId' header in exchange of
> > the 'clientEmail' like this:
>
> > adwords = AdWords::API.new(AdWords::AdWordsCredentials.new(
> > {
> > "developerToken" => "****",
> > "applicationToken" => "****",
> > "password" => "****",
> > "email" => "****",
> > "clientCustomerId" => "12345678"
> > }))
>
> > The XML request looks like:
>
> > <env:Header>
> > <n1:RequestHeader xmlns:n1="https://adwords.google.com/api/
> > adwords/cm/v201008"
> > env:mustUnderstand="0">
>
> > <n1:authToken>*****</n1:authToken>
> > <n1:userAgent>adwords4r: ****</n1:userAgent>
> > <n1:developerToken>*****</n1:developerToken>
> > <n1:applicationToken>*****</n1:applicationToken>
> > <n1:clientCustomerId>12345678</n1:clientCustomerId>
> > </n1:RequestHeader>
> > </env:Header>
>
> > (Obviously I've posted a fake ID here)
>
> > We get the following error in the report we download:
>
> > !!!1|||15589384|||
> > AuthenticationError.CLIENT_CUSTOMER_ID_IS_REQUIRED???
>
> > These are the steps we took to ensure that we are using the correct
> > clientCustomerId:
>
> > - Checked the adwords web console
> > - Using the Account Service in adwords API V13 to get the
> > 'customerId' for this account
>
> > It's important that we get this working with clientCustomerId because
> > the email addresses change so often.
>
> > Any help would be appreciated.
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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