【问题标题】:bingads V13 report request fails in python sdkbingads V13 报告请求在 python sdk 中失败
【发布时间】:2020-07-20 10:58:48
【问题描述】:

我尝试使用 python SDK 下载 bingads 报告,但在提交报告请求后我不断收到错误消息:“找不到类型:'聚合'”。我已经尝试了以下链接中提到的所有 4 个选项: https://github.com/BingAds/BingAds-Python-SDK/blob/master/examples/v13/report_requests.py

请求之前的身份验证过程可以正常工作。

我执行以下操作:

     report_request = get_report_request(authorization_data.account_id)


        reporting_download_parameters = ReportingDownloadParameters(
            report_request=report_request,
            result_file_directory=FILE_DIRECTORY,
            result_file_name=RESULT_FILE_NAME,
            overwrite_result_file=True,  # Set this value true if you want to overwrite the same file.
            timeout_in_milliseconds=TIMEOUT_IN_MILLISECONDS

            
        )
        output_status_message("-----\nAwaiting download_report...")

        download_report(reporting_download_parameters)
 

经过仔细调试,似乎程序在尝试执行“reporting_service_manager.py”中的命令时失败了。这是工作流程:

download_report(self, download_parameters):
    report_file_path = self.download_file(download_parameters)

然后:

download_file(self, download_parameters):
       operation = self.submit_download(download_parameters.report_request)

然后:

submit_download(self, report_request):
        self.normalize_request(report_request)
        response = self.service_client.SubmitGenerateReport(report_request)

SubmitGenerateReport 启动一系列事件,以调用“service_client.py”中的“_SeviceCall.init”函数结束,返回异常“Type not found: 'Aggregation'”

 try:
                response = self.service_client.soap_client.service.__getattr__(self.name)(*args, **kwargs)
                return response
            except Exception as ex:
                if need_to_refresh_token is False \
                        and self.service_client.refresh_oauth_tokens_automatically \
                        and self.service_client._is_expired_token_exception(ex):
                    need_to_refresh_token = True
                else:
                    raise ex

谁能解释一下? .

谢谢

【问题讨论】:

    标签: python python-3.7 bing-ads-api


    【解决方案1】:

    请务必设置 Aggregation 例如,如图所示here

    aggregation = 'Daily'
    

    如果报表类型不使用聚合,可以设置Aggregation=None。

    这有帮助吗?

    【讨论】:

    • 聚合参数设置正确。这就是为什么我没有收到此错误...
    【解决方案2】:

    这可能在事实发生 2 个月后有点晚,但也许这会对其他人有所帮助。我有同样的错误(虽然我想它可能不是同一个问题)。看起来你确实做了我所做的事情(我相信其他人也会这样做):复制粘贴 Microsoft 示例代码并尝试运行它却发现它不起作用。

    我花了很长时间尝试调试该问题,但在我看来,XML 没有被正确搜索。当时我正在使用 suds-py3 作为脚本,所以我尝试了suds-community,之后一切正常。

    我还重新阅读了Bing Ads API walkthrough 以重新开始,发现他们推荐suds-jurko

    长话短说:如果您想使用 bingads API,请不要使用 suds-py3,请使用 suds-community(我可以确认它适用于我使用该 API 的所有内容)或 suds-jurko(是微软推荐的)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-10-31
      • 2010-10-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-05
      • 2021-04-26
      • 1970-01-01
      相关资源
      最近更新 更多