简体   繁体   English

亚马逊广告 api asins 报告类型返回空列表

[英]Amazon advertisement api asins report type returning empty list

I am trying to get the asins report from amazon advertising api.我正在尝试从亚马逊广告 api 获取 asins 报告。 The header and json for creation of the report as follows,用于创建报告的标头和 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"

    ])

The creation of the report returns this,报告的创建返回这个,

{'recordType': 'otherAsin',
 'reportId': 'report_id',
 'status': 'IN_PROGRESS',
 'statusDetails': 'Report is being generated.'}

Get request for the report data returns,获取报表数据返回请求,

{'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.'}

but when calling the location link and as well as trying with the V2 link which is " https://advertising-api-eu.amazon.com/v2/reports/report_id/download ", I get back an empty list like this,但是当调用位置链接并尝试使用“ https://advertising-api-eu.amazon.com/v2/reports/report_id/download ”的V2链接时,我会得到一个这样的空列表,

[]

There should be data for the date as well, any idea why this is happening?日期也应该有数据,知道为什么会这样吗?

I have figured it out, there is a conflict for some reason, if I put both " asin " and " otherAsin " in the asins_json_data dictionary.我已经弄清楚了,如果我将“ asin ”和“ otherAsin ”都放在 asins_json_data 字典中,由于某种原因会发生冲突。 It has to be either one of them in the metrics.它必须是指标中的任何一个。 According to the official document it should not happen.根据官方文件,它不应该发生。 But it also depends on the campaign itself, if they contain the attributes, they should not conflict, vice versa otherwise.但这也取决于活动本身,如果它们包含属性,则它们不应冲突,反之亦然。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM