首页 > 解决方案 > Five9 API python 包装器 - runReport

问题描述

有没有人使用过Five9 API的 python 包装器?

我正在尝试通过 API 运行我们的自定义报告之一,但不确定如何通过时间标准。

如果报告已经建立:
有没有办法在不通过标准的情况下运行它?

看起来这应该足够了(因为报告已经建立):

client.configuration.runReport(folderName='Shared Reports', reportName='Test report')

但它没有按预期工作。
我能做些什么来解决这个问题?

标签: pythonapifive9

解决方案


这对我有用。如果报告完成,您可能会更喜欢使用 while 循环检查报告,但这对时间不敏感。

from five9 import Five9
import time

client = Five9('username','password')
start = '2019-08-01T00:00:00.000'
end = '2019-08-29T00:00:00.000'
criteria = {'time':{'end':end, 'start':start}}
identifier = client.configuration.runReport(folderName='SharedReports',reportName='reportname',criteria=criteria)
time.sleep(15)
get_results = client.configuration.getReportResult(identifier)

推荐阅读