BingAd API报告状态问题 [英] BingAd API Report Status Issue

查看:75
本文介绍了BingAd API报告状态问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我正在使用BingAd API python示例代码:https://msdn.microsoft.com/en-us/library/bing-ads -reporting-request-and-download-a-keyword-performance-report-in-python.aspx下载性能报告。


我注意到在方法"submit_and_download()"中,有报告状态检查说:

 

for i in range(10):
time.sleep(reporting_service_manager.poll_interval_in_milliseconds / 1000.0)

download_status = reporting_operation.get_status()

如果download_status.status =='已完成':
break

我注意到,如果报告完成,状态文本实际上是"成功"而不是" Completed"。

即使该方法在10次尝试后仍会继续,但等待它是不明智的。我是否应该从"已完成"状态改变状态

到"成功"?如果"已完成",则状态已弃用,是否有任何相关文档?

谢谢。



解决方案

谢谢抓住这个问题!报告应该是"成功",批量下载应该是"已完成"。该示例已在GitHub和MSDN中修复,测试,运行和更新。


请注意,您可以通过阅读参考文档来查找真实的服务状态,例如:对PollGenerateReport的回复:


https://msdn.microsoft.com/en-us/library/bing-ads-reporting-pollgeneratereport(v = msads.90)

https:// msdn.microsoft.com/en-us/library/bing-ads-reporting-reportrequeststatustype(v=msads.90).aspx


致以诚挚的问候,

Eric


Hi Everyone,

I am using the BingAd API python example code at: https://msdn.microsoft.com/en-us/library/bing-ads-reporting-request-and-download-a-keyword-performance-report-in-python.aspx to download performance reports.

I noticed that within method "submit_and_download()", there is a report status check says:

for i in range(10): time.sleep(reporting_service_manager.poll_interval_in_milliseconds / 1000.0) download_status = reporting_operation.get_status() if download_status.status == 'Completed': break

What i noticed is that if the report finishes, the status text is actually "Success" instead of "Completed".

Even if the method will continue after 10 tries, it is not wise to wait for that. Should i alter the status

from "Completed" to "Success"? If the "Completed" status is deprecated, is there any document about that?

Thanks.

解决方案

Thanks for catching this issue! It should be 'Success' for reporting, and 'Completed' for bulk download. The sample has been fixed, tested, run, and updated in GitHub and MSDN.

Note you can find the true service status by reading the reference documentation e.g. for the response to PollGenerateReport:

https://msdn.microsoft.com/en-us/library/bing-ads-reporting-pollgeneratereport(v=msads.90).aspx#response

https://msdn.microsoft.com/en-us/library/bing-ads-reporting-reportrequeststatustype(v=msads.90).aspx

Best regards,
Eric


这篇关于BingAd API报告状态问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆