python-amazon-ad-api 2.1.3__py3-none-any.whl → 2.1.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -43,19 +43,11 @@ class AdGroups(Client):
43
43
 
44
44
  Headers
45
45
  | **account_id** (string) -> Amazon-Ads-AccountId
46
- | **manager_account_id** (string) -> Amazon-Ads-Manager-AccountId
47
46
 
48
- Measured on 2026-11-15 against a global advertiser (eleven
49
- marketplaces). The Scope header this client already sends filters the
50
- results by marketplace, and neither of the two above improves on it.
51
- Sending no account header answers 200 with the same page as sending
52
- manager_account_id, which is identical. Sending account_id answers 400
53
- "Multi marketplace query requests only support query by primary resource
54
- id", and sending both answers the same 400 as account_id alone.
55
-
56
- So on a global account pass manager_account_id or nothing: account_id
57
- breaks the call. Adding campaignIdFilter does not fix it, the refusal
58
- is about the header and not about the body.
47
+ The contract declares three parameters on this route: the client id
48
+ (required, the client always sends it), the profile scope (optional,
49
+ sent from the profile_id) and Amazon-Ads-AccountId (optional). There is
50
+ no manager-account header on this route.
59
51
 
60
52
  Returns
61
53
  ApiResponse
@@ -65,14 +57,11 @@ class AdGroups(Client):
65
57
  schema_version = 'application/json'
66
58
  headers = {"Accept": schema_version, "Content-Type": schema_version}
67
59
 
68
- # Optional account headers, taken from kwargs and removed before the
69
- # query is built: left in kwargs they would travel in the query string.
60
+ # Optional account header, taken from kwargs and removed before the
61
+ # query is built: left in kwargs it would travel in the query string.
70
62
  account_id = kwargs.pop('account_id', None)
71
- manager_account_id = kwargs.pop('manager_account_id', None)
72
63
  if account_id:
73
64
  headers["Amazon-Ads-AccountId"] = account_id
74
- if manager_account_id:
75
- headers["Amazon-Ads-Manager-AccountId"] = manager_account_id
76
65
 
77
66
  body = kwargs.pop('body', None)
78
67
  return self._request(kwargs.pop('path'), params=kwargs, headers=headers,
@@ -125,8 +125,26 @@ class Portfolios(Client):
125
125
  schema_version = 'application/json'
126
126
  headers = {"Accept": schema_version, "Content-Type": schema_version}
127
127
  body = kwargs.pop('body', None)
128
- return self._request(kwargs.pop('path'), params=kwargs, headers=headers,
129
- **({'data': Utils.convert_body(body, False)} if body is not None else {}))
128
+ # The contract marks the whole request body optional: no `required: true`
129
+ # on the requestBody, and no required member in QueryPortfolioRequest.
130
+ # The service disagrees. Omitting the body answers 400
131
+ # "Invalid JSON: input is empty"; sending `{}` answers 200 with the
132
+ # default page. Measured 2026-11-22 against leadtech_fr. So an empty
133
+ # body is sent when the caller passes none, and the caller's body is
134
+ # sent as-is otherwise.
135
+ data = Utils.convert_body(body if body is not None else {}, False)
136
+
137
+ # Both account headers are optional in the contract:
138
+ # AccountIdHeaderOptional -> Amazon-Ads-AccountId
139
+ # ScopeHeaderOptional -> Amazon-Advertising-API-Scope (the client
140
+ # already sends it from the profile_id)
141
+ # Taken from kwargs and removed before the query is built: left in kwargs
142
+ # they would travel in the query string.
143
+ account_id = kwargs.pop('account_id', None)
144
+ if account_id:
145
+ headers['Amazon-Ads-AccountId'] = account_id
146
+
147
+ return self._request(kwargs.pop('path'), data=data, params=kwargs, headers=headers)
130
148
 
131
149
  @sp_endpoint('/adsApi/v1/update/portfolios', method='POST')
132
150
  def update_portfolios(self, **kwargs) -> ApiResponse:
ad_api/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "2.1.3"
1
+ __version__ = "2.1.5"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-amazon-ad-api
3
- Version: 2.1.3
3
+ Version: 2.1.5
4
4
  Summary: Python wrapper for the Amazon Advertising API
5
5
  Home-page: https://github.com/denisneuf/python-amazon-ad-api
6
6
  Author: Daniel Alvaro
@@ -1,5 +1,5 @@
1
1
  ad_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- ad_api/version.py,sha256=-5z5R8xV0UToQjp9-3ipF_dBiBdRXtdotx4_h9ZJZT8,22
2
+ ad_api/version.py,sha256=Ol8KeLnnX1kAXAFgJsZj4d_cZMypHQtaiyICJpuzp64,22
3
3
  ad_api/api/__init__.py,sha256=Ain-1s6B4eywYsw3CdYQc2C1KTQdAZy2L3T90KJDYdI,1995
4
4
  ad_api/api/account.py,sha256=X6VPoPsEfGwuABUYVWJATiUpgHSCAz0BreQOHCze9To,4613
5
5
  ad_api/api/account_budgets.py,sha256=jFce5eLWAFK3ydjnYR7_Sv7B0-gHTG5bMTx_TcHyy1A,2319
@@ -99,7 +99,7 @@ ad_api/api/sp/target_promotion_groups.py,sha256=g5QbnFFRvzKdmS9blrD9IJcHtq2RtT9C
99
99
  ad_api/api/v1/__init__.py,sha256=K7rmsKJnWebiarPZknUIcXJKvoIDPI5dBVNrIJGWa2I,1370
100
100
  ad_api/api/v1/ad_associations.py,sha256=g5L8hAIagmsb-yQ09hP7z1zbVVe868NlpOOokv-Mouc,5812
101
101
  ad_api/api/v1/ad_extensions.py,sha256=kL-7xHaXXqb2jXTwZrY0oGttLAG0CW_IjBAqL_CI92U,5519
102
- ad_api/api/v1/ad_groups.py,sha256=Kuiho34wcJju0C_R1tk8kzYF7aoivgpxu15FqDIXnWE,13880
102
+ ad_api/api/v1/ad_groups.py,sha256=n6YiMVYm_TK93CYWmxJIkGFwNSUaRUQRO8LjbDV4Xc0,13170
103
103
  ad_api/api/v1/ads.py,sha256=YwZGQ-4WuYquleELtwRI9L8w0fGw7FBRejQE-tZ5hKY,7941
104
104
  ad_api/api/v1/advertiser_accounts.py,sha256=Y_QqOIt6ggmysEBT59JhrdvTlZ5OQnPduMKX43JTdDU,5468
105
105
  ad_api/api/v1/brand_store_edition_publish_versions.py,sha256=HVeO4ZiPdtjVoVoxQk2xIa8fhcLXSMCquSO1CP4Hbu4,4894
@@ -112,7 +112,7 @@ ad_api/api/v1/label_object_associations.py,sha256=zXuD5cUAfqL-PRObvjOM54KC356HFq
112
112
  ad_api/api/v1/labels.py,sha256=jjPmafIQZTh99Ztj5MCcDC7UyoFFN0YuWdn2syqd3Yg,2438
113
113
  ad_api/api/v1/location_indexes.py,sha256=F9mV1gBwIcFU4WAsYylgO98T_ZapWb_YoA8etJK2Xvo,5880
114
114
  ad_api/api/v1/manager_accounts.py,sha256=iiW0bjS23rn2R_In3Zisn0mSFQsQ6iy6KgkO_JxT-H4,5101
115
- ad_api/api/v1/portfolios.py,sha256=W9NFWJFZ5y8H76WwSmznc6BFHRjDN8XSMxZ2d3-pe9o,7872
115
+ ad_api/api/v1/portfolios.py,sha256=jAbFxPO27laeMhwpzU8_JZJ5sVMdod1eap7Uw88sZIY,8889
116
116
  ad_api/api/v1/recommendation_types.py,sha256=aEBfXu1EhzcRk9Nhin8_ieFiNnBiusX_vWviJw_qD08,2077
117
117
  ad_api/api/v1/recommendations.py,sha256=lb3Jwtwcmq3L8j0HAUKzOt8o_xQRJRduXcjklX_tFw8,4305
118
118
  ad_api/api/v1/reports.py,sha256=vJmWhIsALkX27HeijTsSUz3zrYhUBm4RodTCieJD8Y8,6657
@@ -134,8 +134,8 @@ ad_api/base/marketplaces.py,sha256=44lvCcluXNpqTprWQ80e3weSQmQbJoWL-WDSOWVbCyQ,4
134
134
  ad_api/base/utils.py,sha256=_qnCBOvyJTLgaZjJzUWTi38GGLHkQszXELs79133Rb4,5618
135
135
  ad_api/shared/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
136
136
  ad_api/shared/base_client.py,sha256=zOL_LTh-58URWf3ZDlrwmqXXbd6PX66QF5hrr2p83yY,356
137
- python_amazon_ad_api-2.1.3.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
138
- python_amazon_ad_api-2.1.3.dist-info/METADATA,sha256=JnYhDa59ZilzN9inTTc73JOqZSCwNlWUKB11c7AKUVE,54257
139
- python_amazon_ad_api-2.1.3.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
140
- python_amazon_ad_api-2.1.3.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
141
- python_amazon_ad_api-2.1.3.dist-info/RECORD,,
137
+ python_amazon_ad_api-2.1.5.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
138
+ python_amazon_ad_api-2.1.5.dist-info/METADATA,sha256=IPtVshFjjiVzYSJxjwGbviUHOJbrVSPkPFftrmYRblw,54257
139
+ python_amazon_ad_api-2.1.5.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
140
+ python_amazon_ad_api-2.1.5.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
141
+ python_amazon_ad_api-2.1.5.dist-info/RECORD,,