Very Strange Error: always get <totalNumEntries>0</totalNumEntries>

93 views
Skip to first unread message

Dave L

unread,
Aug 22, 2014, 7:07:20 AM8/22/14
to adwor...@googlegroups.com
Hi,

My code has been working fine until recently (about 2 weeks ago), I have experienced a very strange error. 

I have always got a fresh AccessToken before calling the API. However, I always get "<totalNumEntries>0</totalNumEntries>" for every service I called. There is not error message, but simply "<totalNumEntries>0</totalNumEntries>".

Here is a sample of the response for "AdGroupCriterionService":

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201402"><requestId>00050108ac19b7b00a42662191005c81</requestId><serviceName>AdGroupCriterionService</serviceName><methodName>get</methodName><operations>0</operations><responseTime>216</responseTime></ResponseHeader></soap:Header><soap:Body><getResponse xmlns="https://adwords.google.com/api/adwords/cm/v201402"><rval><totalNumEntries>0</totalNumEntries><Page.Type>AdGroupCriterionPage</Page.Type></rval></getResponse></soap:Body></soap:Envelope>

After many hours testing, by accident, I changed the AccessToken to a fake AccessToken such as "ddddddddddddddddddddddddddddddddddddd" to try, then I can get the correct response data from the server. 

I just cannot believe this, it completely does not make any sense. I am not sure if this is my problem, or an error from Google.

However, by using a fake AccessToken only works for some accounts, but some accounts still did not work no matter what I do.

I really need your help on this. 

Many thanks.
David



Anash P. Oommen (AdWords API Team)

unread,
Aug 22, 2014, 2:23:32 PM8/22/14
to adwor...@googlegroups.com
Hi Dave,

Could you please post a request and response xml where you could get the correct response using a fake OAuth2 access token? And are you using a client library, or your own mechanism to make the API calls?

Cheers,
Anash P. Oommen,
AdWords API Advisor.

Anash P. Oommen (AdWords API Team)

unread,
Aug 22, 2014, 2:36:13 PM8/22/14
to adwor...@googlegroups.com
Hi David,

Looks like you are not setting ClientCustomerId header any longer, so all the requests to fetch specific entries are returning zero results. Could you please check your code and confirm if this is the case?

Cheers,
Anash P. Oommen,
AdWords API Advisor.

On Friday, August 22, 2014 7:07:20 AM UTC-4, Dave L wrote:

David WM Lin

unread,
Aug 24, 2014, 9:41:20 AM8/24/14
to adwor...@googlegroups.com
Hi Anash,

Yes, you are right, I did not set the "ClientCustomerId" header. However, I just do some testing today, the program works fine again with or without the "clientCustomerid" header. Very strange indeed. 

I will include ClientCustomerid header from now and hope this will fix the problem. 

Many thanks for you.

David

Anash P. Oommen (AdWords API Team)

unread,
Aug 25, 2014, 9:57:34 AM8/25/14
to adwor...@googlegroups.com
Hi David,

If things started working for you, then one possibility is that your OAuth2 headers now resolve to that of an advertiser account instead of an MCC account. I recommend setting the clientCustomerId all the time, so you know for sure what account you are making calls against.

Cheers,
Anash
Reply all
Reply to author
Forward
0 new messages