为什么未抽样报告的Google Analytics(分析)API不显示Google云端硬盘下载链接?

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

CSV已下载到Google云端硬盘,但是当我使用以下方法查询未抽样的报告ID时,get unsampled report响应中没有下载类型...

这是应该显示的resource。但我得到了部分回应:

{
  "id": string,
  "kind": "analytics#unsampledReport",
  "selfLink": string,
  "title": string,
  "accountId": string,
  "webPropertyId": string,
  "profileId": string,
  "start-date": string,
  "end-date": string,
  "status": string,
  "created": datetime,
  "updated": datetime 
}

我有一个启用了以下API的服务帐户:

  • Google Analytics API
  • Google Analytics Reporting API
  • Google Drive API

我拥有我在Google Analytics(分析)中服务帐户的所有权限。

我正在使用python客户端发出请求:

accountId = self._ga_property.account_id
web_property_id = self._ga_property.web_property_id
unsampled_report = self._auth_service.management().unsampledReports().get(
            accountId=accountId,
            webPropertyId=web_property_id,
            profileId=self._profileId,
            unsampledReportId=id
        ).execute()
return unsampled_report

如果您需要任何其他信息,我们很乐意为您提供。

我已经尝试过Stack Overflow answer,但下载链接不在我的回复内。

问题没有得到答复,问题得到了[[部分答复

python google-analytics google-drive-api google-analytics-api
1个回答
0
投票
如果状态为COMPLETE,您可以在响应中找到下载链接。查询非抽样报告时,状态为PENDING。尝试在几分钟后调用报告ID,并且状态为COMPLETE时,API应该返回driveDownloadDetails.documentId。
© www.soinside.com 2019 - 2024. All rights reserved.