如何修复API弃用错误

问题描述 投票:0回答:2

今天是第一次发生这种情况:

suds.WebFault: Server raised fault: '[RequestError.UNSUPPORTED_VERSION @ ; trigger:'You are accessing an AdWords API version v201708 that has been discontinued. Calls to this version may fail. Please visit the AdWords API blog for information on migration to the new AdWords API version.']'

它是有意义的,因为它宣布here几天前它是日落。

所以我按照他们的建议将字符串更改为"v201802",现在它给出了不同的错误

googleads.errors.GoogleAdsValueError: Unrecognized version for the AdWords API. Given: v201802 Supported: ['v201702', 'v201609', 'v201708', 'v201705']

它仅支持似乎已弃用的版本。

pip freeze的相关产出是:

apiclient==1.0.3
google-api-python-client==1.6.0
googleads==7.0.0

但不确定它与此有什么关系。有任何想法吗?

python google-api google-adwords
2个回答
0
投票

pip install --upgrade googleads似乎修复了它。新版本googleads==11.0.0使用API​​版本字符串"v201710",在googleads更新后被接受。没有什么需要改变。


0
投票

处理谷歌广告有点凝灰岩,但这个问题有一个非常简单的解决方案。因为我们只需要切换版本。

1 - 更新googleads libs:pip install --upgrade googleads

2 - 您需要在使用此代码的任何地方将v201802更改为v201809

为什么 - v201809是9月发布的最新版本。

campaign_service = client.GetService('CampaignService', version='v201809')

© www.soinside.com 2019 - 2024. All rights reserved.