Newbie issue with PHP v6 library

75 views
Skip to first unread message

Tim Relton

unread,
Nov 26, 2020, 6:53:59 AM11/26/20
to AdWords API and Google Ads API Forum
Hi,

New to this API, so forgive me is this is really basic stuff.

Trying to implement the Get Campaigns test on a manager account with client data and I am getting thrown an API log as follows.....

[2020-11-26T11:48:21.522935+00:00] google-ads.WARNING: Request made: Host: "googleads.googleapis.com", Method: "/google.ads.googleads.v6.services.GoogleAdsService/SearchStream", CustomerId: 9876543211, RequestId: "", IsFault: 1, FaultMessage: "None"  
[2020-11-26T11:48:21.524949+00:00] google-ads.NOTICE: Request
-------
Method Name: /google.ads.googleads.v6.services.GoogleAdsService/SearchStream
Host: googleads.googleapis.com
Headers: {
    "x-goog-api-client": "gl-php\/7.3.24 gapic\/ gax\/1.6.0 grpc\/1.32.0",
    "x-goog-request-params": "customer_id=9876543211",
    "developer-token": "REDACTED",
    "login-customer-id": "111-222-3333"
}
Request:
{"customerId":"9876543211","query":"SELECT campaign.id, campaign.name FROM campaign ORDER BY campaign.id"}

Response
-------
Headers: {
    "date": "Thu, 26 Nov 2020 11:48:21 GMT",
    "alt-svc": "h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""
}

Fault
-------
Status code: 13
Details: Internal error encountered.
Failure: {} 

I have to confess this is driving me slightly mad!  Any guidance would be very welcome.

Thanks

Google Ads API Forum Advisor Prod

unread,
Nov 27, 2020, 4:53:54 AM11/27/20
to tsre...@gmail.com, adwor...@googlegroups.com
Hi Tim,

Thanks for posting your concern.

The INTERNAL_ERROR usually occurs when something unexpected happened while processing the request such as a bug. However, retrying API request after some time will make it work.

However, if this error is occurring frequently, then please provide the customer ID and complete request and response logs with request ID to investigate. You can provide it via Reply privately to author option.

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q28lAef:ref

Tim Relton

unread,
Nov 27, 2020, 7:28:48 AM11/27/20
to AdWords API and Google Ads API Forum
Hello,

Thanks for the reply.  Sadly this happens 100% of the time.

From a terminal window on cPanel....

$ cd google-ads-php
google-ads-php]$ php examples/BasicOperations/GetCampaigns.php --customerId 987-654-3210

also

google-ads-php]$ php examples/BasicOperations/GetCampaigns.php --customerId 9876543210

gives me the same output api.log as sent (obviously with IDs changed).

For some reason I can't send a private reply.  Can you fix this so I can send over logs and Manager / Client IDs, keys etc?

Google Ads API Forum Advisor Prod

unread,
Dec 1, 2020, 4:55:20 AM12/1/20
to tsre...@gmail.com, adwor...@googlegroups.com
Hi Tim,

Sorry to hear that.

Please provide the requested details on this email address googleadsa...@google.com for privacy purposes.

Also, if you haven't enabled yet the logging of API transaction for PHP client library, you may follow this guide.

Google Ads API Forum Advisor Prod

unread,
Dec 3, 2020, 2:50:08 AM12/3/20
to tsre...@gmail.com, adwor...@googlegroups.com
Hi Tim,

I am updating this thread to let you know that we have received the requested information. Allow me now to reach out to the rest of our team to discuss and investigate further. We'll reach back once we have updates.

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q28lAef:ref

Google Ads API Forum Advisor Prod

unread,
Dec 3, 2020, 6:40:46 PM12/3/20
to tsre...@gmail.com, adwor...@googlegroups.com
Hi Tim,

Thanks for this information and for trying out the Google Ads API. I can see a couple issues with the request logs you sent which are independent of the PHP library. I'm a little unsure why you don't receive a more meaningful error message though. I'll help you work through some of the things I can see, but if something specific to the PHP library comes up I'm going to ask you to file an Issue on their GitHub repo, there the maintainers or other users will be able to offer more specialized support.

First, the CID you're using (9876543211) doesn't actually appear to be valid. Second the login-customer-id appears to not only be invalid, but it isn't formatted correctly - it should not include the hyphens as it does in your request.

Have you gone through our Quickstart Guide and followed the instructions on how to create an account and OAuth credentials to make a request to our API? They will explain how to attain a valid Customer ID as well as how to use the login-customer-id header (you don't always need to include it).

Here are additional instructions specific to the PHP client library, if you haven't already seen them.

Let me know if you've gone over these yet, and whether you expect that this CID should in fact be valid.

Thanks,
Ben, Google Ads API Team

ref:_00D1U1174p._5004Q28lAef:ref

Tim Relton

unread,
Dec 7, 2020, 7:20:51 AM12/7/20
to AdWords API and Google Ads API Forum
Ben,

The CID you are using is the original fake one I used to originally open this question and protect private details.  There is an email as requested above by Peter on 3rd December, that I have replied to, that contains all the CIDs, keys, api logs and developer keys that are being used.  Can you retrieve this file and check again?

Many thanks

Google Ads API Forum Advisor Prod

unread,
Dec 7, 2020, 9:46:42 AM12/7/20
to tsre...@gmail.com, adwor...@googlegroups.com
Hi Tim - 

Gotcha, sorry about the confusion there. I did find the log file you sent. The Customer ID in it appears to be incomplete, i.e. it's only 3 digits instead of 10. When you execute the example, how are you passing this value in? Are you using the command-line arguments or inserting the values into the script directly? In either case you should be passing it in as an integer without hyphens, i.e. 1234567890 and not 123-456-7890.

Let me know if that helps with the error.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages