Ads API "Bad metadata value given"

190 views
Skip to first unread message

Remco Aalderink

unread,
Mar 28, 2019, 5:09:40 PM3/28/19
to AdWords API and Google Ads API Forum

We've just started on testing out the new Google Ads API, and have ran into the "Bad metadata value given" error message today. Yesterday, the following code worked:

$configuration = new Configuration($iniFileContents);

$tokenBuilder = new OAuth2TokenBuilder();
$credentials = $tokenBuilder->from($configuration)->build();

$clientBuilder = new GoogleAdsClientBuilder();
$clientBuilder->from($configuration)
  ->withOAuth2Credential($credentials)
  ->withLoginCustomerId([customer ID as int]);

$client = $clientBuilder->build();

$client->getCustomerServiceClient()->listAccessibleCustomers();

But when I started on it again this morning, it threw the "Bad metadata value given" error. I do not see why this has suddenly happened. Any ideas?

googleadsapi...@google.com

unread,
Mar 28, 2019, 10:45:34 PM3/28/19
to AdWords API and Google Ads API Forum
Hi,

Thank you for reaching out. To further investigate, could you provide the complete JSON request and response logs when you encountered the error? Please reply via Reply privately to author. If you haven't enabled logging yet, you may refer to this guide as to how.

Regards,
Dave Paurillo
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/951a1ab2-1bc4-4ce0-981d-12327c69458f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Remco Aalderink

unread,
Mar 29, 2019, 3:48:05 AM3/29/19
to AdWords API and Google Ads API Forum
Hello,

In the meantime, I have figured out what the issue was. I was sending the value of the login-customer-id as an int, which is the PHPDoc typehint in the PHP library, but gRPC expects a string. Once I made the value a string the issue was solved.
Reply all
Reply to author
Forward
0 new messages