Search code examples
pythonamazon-advertising-api

AWS ADs - Can't create SponsoredBrands report [message: configuration reportTypeId is unknown or invalid]


As a 'reportTypeId' I'm using 'sbCampaigns' as it was in a sample call "Sponsored Brands: Campaign summary report grouped by campaign"

https://advertising.amazon.com/API/docs/en-us/guides/reporting/v3/report-types/campaign#sponsored-brands-campaign-summary-report-grouped-by-campaign

Here's the full text of the error: {"code":"400","detail":"configuration reportTypeId is unknown or invalid"}

Here's my code:

REPORT_ENDPOINT = "https://advertising-api.amazon.com/reporting/reports"

        headers = {
            "Authorization": f"Bearer {access_token}",
            "Amazon-Advertising-API-ClientId": self.credentials["client_id"],
            "Amazon-Advertising-API-Scope": self.credentials["profile_id"],
            "Content-Type": "application//vnd.createasyncreportrequest.v3+json"
        }

        report_request = {
            "name": "SponsoredBrandsReport",
            "startDate": self.startdate,
            "endDate": self.enddate,
            "configuration": {
                "adProduct": "SPONSORED_BRANDS",
                "groupBy": [
                    "campaign"
                ],
                "columns": [
                    "campaignName",
                    "impressions",
                    "clicks",
                    "cost",
                    "sales",
                    "purchases",
                    "unitsSold"
                ],
                "reportTypeId": "sbCampaigns",
                "timeUnit": "SUMMARY",
                "format": "GZIP_JSON"
            }
        }

I'm trying to request a Sponsored Brands Report from Amazon Ads API


Solution

  • Sponsored Brand Reports are in preview mode and I need to gain access by submitting a Jira ticket here: https://amzn-clicks.atlassian.net/servicedesk/customer/portal/2/group/2