Hi,

Thank you for reaching out. To further investigate this, could you provide
the complete JSON request and response logs when you encountered the error?
If you haven't enabled logging yet, you may do so by following this guide
<https://github.com/googleads/google-ads-php/#logging>.

Regards,
Dave
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

On 05/09/19 17:23:19 [email protected] wrote:

Good morning,

We are trying to get a list of accessible customers from our account using
the PHP Google Ads API, but we are receiving an error every time we try.
The error is kind of generic:

ApiException was thrown with message '{ "message": "Internal error
encountered.", "code": 13, "status": "INTERNAL", "details": [] }'.


 This is the code that produces the error:

$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...
        }



All the API tokens seem to be fine when using the AdWords API but seem to
fail with the Ads API.
Has anyone experienced this issue or can shed some light on this?

Thank you very much in advance for your help.

Hope you have an excellent day


--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [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
---
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 [email protected].
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
<https://groups.google.com/d/msgid/adwords-api/1849c524-af83-4a16-bd32-b08982bbd76c%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [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
--- 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 [email protected].
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/00d12h422g0000018793m2000vpq4ow6smj4chm70o30c1g68r34chi%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
  • Error w... Adbibo Technologies
    • RE... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
      • ... Adbibo Technologies
        • ... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum

Reply via email to