【发布时间】:2022-06-24 20:08:56
【问题描述】:
我正在尝试从亚马逊广告 api 获取 asins 报告。 创建报表的header和json如下,
headers = {
"Authorization": f"Bearer {access_code}",
"Amazon-Advertising-API-ClientId": "client_id",
"Amazon-Advertising-API-Scope": "Profile_id"
}
asins_json_data = {
"reportDate": "20220227",
"campaignType": "sponsoredProducts",
"metrics": ",".join([
"adGroupId",
"adGroupName",
"asin",
"attributedSales14dOtherSKU",
"attributedSales1dOtherSKU",
"attributedSales30dOtherSKU",
"attributedSales7dOtherSKU",
"attributedUnitsOrdered14d",
"attributedUnitsOrdered14dOtherSKU",
"attributedUnitsOrdered1d",
"attributedUnitsOrdered1dOtherSKU",
"attributedUnitsOrdered30d",
"attributedUnitsOrdered30dOtherSKU",
"attributedUnitsOrdered7d",
"attributedUnitsOrdered7dOtherSKU",
"campaignId",
"campaignName",
"currency",
"keywordText",
"matchType",
"otherAsin",
"targetingExpression",
"targetingType"
])
报表的创建返回这个,
{'recordType': 'otherAsin',
'reportId': 'report_id',
'status': 'IN_PROGRESS',
'statusDetails': 'Report is being generated.'}
获取报表数据返回请求,
{'expiration': 1654041600000,
'fileSize': 22,
'location': 'https://advertising-api-eu.amazon.com/v1/reports/report_id/download',
'reportId': 'report_id',
'status': 'SUCCESS',
'statusDetails': 'Report has been successfully generated.'}
但是在调用位置链接以及尝试使用 V2 链接时 "https://advertising-api-eu.amazon.com/v2/reports/report_id/download", 我得到一个这样的空列表,
[]
也应该有日期的数据,知道为什么会这样吗?
【问题讨论】:
标签: python amazon-advertising-api