我尝试从Amazon Advertising API获取ASIN报告。 我向https://advertising-api-test.amazon.com/v2/asins/report
创建了POST请求请求-标头:
我确信标题正确(包括身份验证),因为其他类似的报告请求也可以正常工作。
Content-Type: application/json
Amazon-Advertising-API-ClientID: XXXXXXXXX
Amazon-Advertising-API-Scope: XXXXXXXXX
Authorization: Bearer Atza|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
请求-正文:
{
"campaignType": "sponsoredProducts",
"reportDate":"20190528",
"metrics": "campaignName,campaignId,adGroupName,adGroupId,keywordText,keywordId,matchType,asin,otherAsin,sku,currency,attributedUnitsOrdered30dOtherSKU,attributedSales30dOtherSKU"
}
预期的响应:
{
"reportId": "amzn1.clicksAPI.v1.m1.5D133A56.9efaeb90-46d1-41e8-82bb-fc9acf2798b8",
"recordType": "ASIN",
"status": "IN_PROGRESS",
"statusDetails": "Generating report"
}
回复:
{
"code": "400",
"details": " Filter type is null",
"requestId": "TVHWE5DY8PJNNBEQRK46"
}
问题:
我不知道请求所需的过滤器类型,或者我还必须如何解释该错误。我在官方文档https://advertising.amazon.com/API/docs/v2/reference/reports#ASINs-report中找不到任何信息 所以我希望在这里找到解决方案...
答案 0 :(得分:-1)
您可以发布用于获取报告位置并下载gzip文件的代码吗?
这是我下载搜索字词报告的代码
def requestSearchTermReport(profileId)
return Unirest.post("https://#{@endpoint}/v2/sp/targets/report",
headers: @headers,
parameters: {"segment"=>"query", "metrics" => "clicks", "reportDate" => "20190701"}.to_json
).body
end