KeyError when attempting to create a new call asset instance

22 views
Skip to first unread message

Marvin Laskov

unread,
Dec 24, 2021, 5:07:12 AM12/24/21
to AdWords API and Google Ads API Forum
A snippet of the script I have written to create a new call extension asset   
  • asset_service = client.get_service("AssetService")
  •     asset_operation = client.get_type("AssetOperation")
  •     asset = asset_operation.create
  •     asset.name = 'Test Call Asset 1'
  •     # Creates a new call asset instance.
  •     call_asset = asset.call_asset
This script is returning me a KeyError: 'call_asset'
I was able to use a similar script for structured snippets and sitelinks via:
  • sitelink_asset = asset.sitelink_asset
or
  • snippet_asset = asset.structured_snippet_asset

I don't know why this isn't working for call asset.

Google Ads API Forum Advisor

unread,
Dec 27, 2021, 6:32:38 AM12/27/21
to marvin...@gmail.com, adwor...@googlegroups.com

Hello Marvin,

Thank you for reaching out to us.

Have you checked on this sample code when creating an asset? So our team can further check on the error you've encountered, can you share to us the complete API logs (request and response with request-id) generated? In the Google Ads API, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link.

Once those logs are already available, please send the requested details via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Regards,

Google Logo
Mark Kevin Albios
Google Ads API Team
 


ref:_00D1U1174p._5004Q2TkSLm:ref

Marvin Laskov

unread,
Dec 27, 2021, 7:13:48 AM12/27/21
to AdWords API and Google Ads API Forum
Hi Mark,

I have managed to resolve it, seems the issue was that I was using the older version of google-ads library I installed in June which did not have call_asset in the asset resource yet.
It worked after updating the google-ads library to the most recent one.

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