【问题标题】:Amazon advertisement api asins report type returning empty list亚马逊广告 api asins 报告类型返回空列表
【发布时间】: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


    【解决方案1】:

    我已经弄清楚了,如果我将“asin”和“otherAsin”都放在 asins_json_data 字典中,由于某种原因会发生冲突。它必须是指标中的任何一个。 根据official document,它不应该发生。但这也取决于活动本身,如果它们包含属性,则不应冲突,反之亦然。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多