ApiException was thrown with message '{ "message": "Internal error encountered.", "code": 13, "status": "INTERNAL", "details": [] }'.
$oAuth2Credential = (new OAuth2TokenBuilder())
->withClientId(env('GOOGLE_CLIENT_ID'))
->withClientSecret(env('GOOGLE_CLIENT_SECRET'))
->withRefreshToken(Auth::user()->google_refresh)
->build();
// Construct a Google Ads client configured from a properties file and the
// OAuth2 credentials above.
$googleAdsClient = (new GoogleAdsClientBuilder())
->withOAuth2Credential($oAuth2Credential)
->withDeveloperToken(env('GOOGLE_DEVELOPER_TOKEN'))
->withLoginCustomerId(env('GOOGLE_CCI'))
->build();
// dd($googleAdsClient);
try {
$customerServiceClient = $googleAdsClient->getCustomerServiceClient();
// dd($customerServiceClient);
// Issues a request for listing all accessible customers.
$accessibleCustomers = $customerServiceClient->listAccessibleCustomers(); // THIS IS THE LINE WHICH ACTUALLY PRODUCES THE ERROR
dd($accessibleCustomers);
print 'Total results: ' . count($accessibleCustomers) . PHP_EOL;
// Iterates over all accessible customers' resource names and prints them.
foreach ($accessibleCustomers->getResourceNames() as $resourceName) {
/** @var string $resourceName */
printf("Customer resource name: '%s'%s", $resourceName, PHP_EOL);
}
} catch (GoogleAdsException $googleAdsException) {
// error handling...
}
Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.
Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@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/1849c524-af83-4a16-bd32-b08982bbd76c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
thanks for your quick response. This is the logged response:
[2019-05-10 10:00:10] local.INFO: Request made: Host: "googleads.googleapis.com", Method: "/google.ads.googleads.v1.services.CustomerService/ListAccessibleCustomers", ClientCustomerId: 0, RequestId: "", IsFault: 1, FaultMessage: "None"
[2019-05-10 10:00:10] local.INFO: Request
-------
Method Name: /google.ads.googleads.v1.services.CustomerService/ListAccessibleCustomers
Host: googleads.googleapis.com
Headers: {
"x-goog-api-client": "gl-php\/7.2.17-0ubuntu0.18.04.1 gapic\/ gax\/0.38.0 grpc\/1.20.0",
"developer-token": "REDACTED",
"login-customer-id": "643-083-7108"
}
Request: {}
Response
-------
Headers: {
"date": "Fri, 10 May 2019 10:00:10 GMT",
"alt-svc": "quic=\":443\"; ma=2592000; v=\"46,44,43,39\""
}
Fault[2019-05-10 10:00:10] local.INFO: Request made: Host: "googleads.googleapis.com", Method: "/google.ads.googleads.v1.services.CustomerService/ListAccessibleCustomers", ClientCustomerId: 0, RequestId: "", IsFault: 1, FaultMessage: "None"[2019-05-10 10:00:10] local.INFO: Request-------Method Name: /google.ads.googleads.v1.services.CustomerService/ListAccessibleCustomersHost: googleads.googleapis.comHeaders: {"x-goog-api-client": "gl-php\/7.2.17-0ubuntu0.18.04.1 gapic\/ gax\/0.38.0 grpc\/1.20.0","developer-token": "REDACTED","login-customer-id": "XXX-XXX-XXXX" // removed for anonimity}Request: {}Response-------Headers: {"date": "Fri, 10 May 2019 10:00:10 GMT","alt-svc": "quic=\":443\"; ma=2592000; v=\"46,44,43,39\""}Fault-------Status code: 13Details: Internal error encountered.Failure: {}E-------
Status code: 13
Details: Internal error encountered.
Failure: {}
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/78e5b3ab-f7d8-4a00-a92f-bcc894e7f1a1%40googlegroups.com.