amazon-advertising-api

Amazon Advertising API: ASINs report request returns “Missing campaign type”


Request to API-Endpoint:
POST https://advertising-api-eu.amazon.com/v2/asins/report

Official documentation:
https://advertising.amazon.com/API/docs/en-us/reference/sponsored-products/2/reports

Headers:

Authorization: Bearer Atza|xxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json
Amazon-Advertising-API-ClientId: xxxxxxxxxxxxxxxxxxxxxxxxxx
Amazon-Advertising-API-SCOPE: xxxxxxxxxxxxxxxxxxxxxxx

Request:

 {
    "segment": "query",
    "reportDate":"20200201",
    "metrics": "campaignName,campaignId,adGroupName,adGroupId,keywordId,keywordText,asin,otherAsin,currency,matchType,attributedUnitsOrdered30d,attributedUnitsOrdered30dOtherSKU,attributedSales30dOtherSKU"
 }  

Response:

{
    "code": "400",
    "details": "Missing campaign type",
    "requestId": "7Q8PMWM2618KAS0VEG87"
}

Question:

I think the error message is misleading (because i checked the documentation twice and because of my former experiences with the API). But what is the real error? How can i get a ASINs report?


Solution

  • I asked Amazon Support and they replied:

    "Asin report would need campaignType in the payload to succeed the operation. We have a documentation update pending on this. Please be noted that query segmentation is only allowed for keyword, target and productAds report. An example payload:-

    GET https://advertising-api.amazon.com/v2/asins/report"

    {
        "reportDate":"20200201",
        "campaignType": "sponsoredProducts",
        "metrics":"campaignName,
                   campaignId,
                   adGroupName,
                   adGroupId,
                   keywordId,
                   keywordText,
                   asin,
                   otherAsin,
                   currency,
                   matchType,
                   attributedUnitsOrdered30d,
                   attributedUnitsOrdered30dOtherSKU,
                   attributedSales30dOtherSKU"
    }