Skip to content

v0.1.0

Compare
Choose a tag to compare
@denisneuf denisneuf released this 09 Nov 16:12
· 496 commits to main since this release

Added support for Sponsored Display Advertising Modules:

  • Campaigns
  • Ad Groups

Added Debug

Added a kwarg parameter debug=True will provide log info about header sent, method and URL and raw Response. Example:

try:
    states = 'enabled'
    result = Campaigns(debug=True).list_campaigns_extended(
        stateFilter=states
    )
    logging.info(result.payload)

except AdvertisingApiException as error:
    logging.info(ex)

Will return:

Header:

INFO:{'User-Agent': 'python-ad-api-0.1.0', 'Amazon-Advertising-API-ClientId': 'Your-Client-ID', 'Authorization': 'Bearer Your-Token', 'Amazon-Advertising-API-Scope': 'Your-Scope', 'Content-Type': 'application/json'}

Method URL:

INFO:GET https://advertising-api-test.amazon.com/v2/sp/campaigns/extended

Raw Response:

INFO:{'_content': b'[{"campaignId":215197523378948,"name":"CAMPAIGN.TEST.AD.API.SANDBOX.MANUAL.011","campaignType":"sponsoredProducts","targetingType":"manual","premiumBidAdjustment":false,"dailyBudget":20.0,"startDate":"20211201","state":"enabled","bidding":{"strategy":"legacyForSales","adjustments":[]},"portfolioId":214026997044134,"tags":{"PONumber":"10322924","accountManager":"Manager-ES"},"servingStatus":"PENDING_START_DATE","creationDate":1635272586000,"lastUpdatedDate":1635272586000}]', '_content_consumed': True, '_next': None, 'status_code': 200, 'headers': {'Server': 'Server', 'Date': 'Tue, 09 Nov 2021 15:51:39 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'x-amz-rid': '1CN2T09DBD8KF94501D1', 'x-amz-request-id': '1CN2T09DBD81925701D1', 'Vary': 'Content-Type,Accept-Encoding,X-Amzn-CDN-Cache,X-Amzn-AX-Treatment,User-Agent', 'Permissions-Policy': 'interest-cohort=()'}, 'raw': <urllib3.response.HTTPResponse object at 0x1062610d0>, 'url': 'https://advertising-api-test.amazon.com/v2/sp/campaigns/extended?stateFilter=enabled', 'encoding': 'utf-8', 'history': [], 'reason': '', 'cookies': <RequestsCookieJar[]>, 'elapsed': datetime.timedelta(seconds=2, microseconds=379280), 'request': <PreparedRequest [GET]>, 'connection': <requests.adapters.HTTPAdapter object at 0x106201c10>}

Added Marketplaces Missing:

North America (NA, US, CA, MX)
Far East (JP, AU)
Europe (UK alias GB, AE) EU can be used as wildcard when currency is EUR
Thanks to @mkdir700