python-amazon-ad-api 1.0.0__py3-none-any.whl → 1.0.1__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.
- ad_api/api/v1/__init__.py +7 -0
- ad_api/api/v1/ad_groups.py +201 -0
- ad_api/api/v1/campaigns.py +180 -0
- ad_api/version.py +1 -1
- {python_amazon_ad_api-1.0.0.dist-info → python_amazon_ad_api-1.0.1.dist-info}/METADATA +1 -1
- {python_amazon_ad_api-1.0.0.dist-info → python_amazon_ad_api-1.0.1.dist-info}/RECORD +9 -6
- {python_amazon_ad_api-1.0.0.dist-info → python_amazon_ad_api-1.0.1.dist-info}/WHEEL +0 -0
- {python_amazon_ad_api-1.0.0.dist-info → python_amazon_ad_api-1.0.1.dist-info}/licenses/LICENSE +0 -0
- {python_amazon_ad_api-1.0.0.dist-info → python_amazon_ad_api-1.0.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
from ad_api.base import Client, sp_endpoint, ApiResponse, Utils
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class AdGroups(Client):
|
|
5
|
+
r"""
|
|
6
|
+
AdGroups(account='default', marketplace: Marketplaces = Marketplaces.EU, credentials=None, debug=False)
|
|
7
|
+
|
|
8
|
+
Amazon Ads API v1 - unified Ad Groups endpoints
|
|
9
|
+
|
|
10
|
+
The v1 API is not split by product: every call goes to the same resource
|
|
11
|
+
(``/adsApi/v1/...``) and the product is selected in the request body via
|
|
12
|
+
``adProductFilter``.
|
|
13
|
+
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
@sp_endpoint('/adsApi/v1/query/adGroups', method='POST')
|
|
17
|
+
def query_ad_groups(self, **kwargs) -> ApiResponse:
|
|
18
|
+
r"""
|
|
19
|
+
query_ad_groups(body: dict) -> ApiResponse
|
|
20
|
+
|
|
21
|
+
Amazon Ads API v1 - Query Ad Groups (operationId: QueryAdGroup)
|
|
22
|
+
|
|
23
|
+
Request Body [Required]
|
|
24
|
+
| **adProductFilter** (dict) : [required]
|
|
25
|
+
| **include** (list<AdProduct>) : Enum [ AMAZON_DSP, SPONSORED_BRANDS, SPONSORED_DISPLAY, SPONSORED_PRODUCTS, SPONSORED_TELEVISION ]
|
|
26
|
+
| **adGroupIdFilter** (dict) [optional]
|
|
27
|
+
| **include** (list<string>) : Ad group identifiers
|
|
28
|
+
| **campaignIdFilter** (dict) [optional]
|
|
29
|
+
| **include** (list<string>) : Campaign identifiers
|
|
30
|
+
| **inventoryTypeFilter** (dict) [optional]
|
|
31
|
+
| **include** (list<InventoryType>) : Enum [ AAP_MOBILE_APP, AMAZON_MOBILE_DISPLAY, AUDIO, AUDIO_AMAZON_DEAL, DISPLAY, LIVE_EVENTS, ONLINE_VIDEO, PODCAST, STANDARD_DISPLAY, STREAMING_TV, STREAMING_TV_AMAZON_DEAL, VIDEO ]
|
|
32
|
+
| **marketplaceScopeFilter** (dict) [optional]
|
|
33
|
+
| **include** (list<MarketplaceScope>) : Enum [ GLOBAL, SINGLE_MARKETPLACE ]
|
|
34
|
+
| **nameFilter** (dict) [optional]
|
|
35
|
+
| **include** (list<string>) : Ad group names
|
|
36
|
+
| **queryTermMatchType** (string) : [required] Enum [ BROAD_MATCH, EXACT_MATCH ]
|
|
37
|
+
| **retailerScopeFilter** (dict) [optional]
|
|
38
|
+
| **include** (list<RetailerScope>) : Enum [ AMAZON, OTHER_RETAILERS ]
|
|
39
|
+
| **stateFilter** (dict) [optional]
|
|
40
|
+
| **include** (list<State>) : Enum [ ARCHIVED, DRAFT, ENABLED, PAUSED ]
|
|
41
|
+
| **maxResults** (int) [optional] Maximum number of records in the response
|
|
42
|
+
| **nextToken** (string) [optional] Token to navigate to the next page
|
|
43
|
+
|
|
44
|
+
Headers
|
|
45
|
+
| **Amazon-Ads-AccountId** (string) [optional] Advertiser account identifier
|
|
46
|
+
|
|
47
|
+
Returns
|
|
48
|
+
ApiResponse
|
|
49
|
+
| **adGroups** (list), **nextToken** (string)
|
|
50
|
+
|
|
51
|
+
"""
|
|
52
|
+
schema_version = 'application/json'
|
|
53
|
+
headers = {"Accept": schema_version, "Content-Type": schema_version}
|
|
54
|
+
body = kwargs.pop('body', None)
|
|
55
|
+
return self._request(kwargs.pop('path'), params=kwargs, headers=headers,
|
|
56
|
+
**({'data': Utils.convert_body(body, False)} if body is not None else {}))
|
|
57
|
+
|
|
58
|
+
@sp_endpoint('/adsApi/v1/create/adGroups', method='POST')
|
|
59
|
+
def create_ad_groups(self, **kwargs) -> ApiResponse:
|
|
60
|
+
r"""
|
|
61
|
+
create_ad_groups(body: dict) -> ApiResponse
|
|
62
|
+
|
|
63
|
+
Amazon Ads API v1 - Create Ad Groups (operationId: CreateAdGroup)
|
|
64
|
+
|
|
65
|
+
Request Body [Required]
|
|
66
|
+
| **adGroups** (list<dict>) : [required] One or more ad group objects.
|
|
67
|
+
Each object requires **adProduct**, **campaignId**, **name** and **state**.
|
|
68
|
+
|
|
69
|
+
Ad group fields
|
|
70
|
+
| **adProduct** (string) : [required] Enum [ AMAZON_DSP, SPONSORED_BRANDS, SPONSORED_DISPLAY, SPONSORED_PRODUCTS, SPONSORED_TELEVISION ]
|
|
71
|
+
| **campaignId** (string) : [required] Identifier of the parent campaign
|
|
72
|
+
| **name** (string) : [required] Name of the ad group
|
|
73
|
+
| **state** (string) : [required] Enum [ DRAFT, ENABLED, PAUSED ]
|
|
74
|
+
| **bid** (dict) [optional]
|
|
75
|
+
| **baseBid** (number) : Base bid value
|
|
76
|
+
| **defaultBid** (number) : Default bid value
|
|
77
|
+
| **maxAverageBid** (number) : Maximum average bid
|
|
78
|
+
| **marketplaceSettings** (list<dict>) : Per marketplace bids
|
|
79
|
+
| **currencyCode** (string) : [required] Enum CurrencyCode (EUR, USD, GBP, ...)
|
|
80
|
+
| **marketplace** (string) : [required] Marketplace
|
|
81
|
+
| **defaultBid** (number) : Default bid for that marketplace
|
|
82
|
+
| **budgets** (list<dict>) [optional] See Campaigns budget shape:
|
|
83
|
+
``budgetType``, ``budgetValue.monetaryBudgetValue.monetaryBudget`` (``currencyCode`` + ``value``), ``recurrenceTimePeriod``
|
|
84
|
+
| **optimization** (dict) [optional]
|
|
85
|
+
| **bidStrategy** (string) : Enum [ MANUAL, NEW_TO_BRAND, PRIORITIZE_KPI_TARGET, RULE_BASED, SALES_DOWN_ONLY, SALES_UP_AND_DOWN, SPEND_BUDGET_IN_FULL, USE_CAMPAIGN_STRATEGY ]
|
|
86
|
+
| **budgetSettings** (dict) : ``budgetAllocation`` (Enum AUTO, MANUAL) and ``dailyMinSpendValue`` (number)
|
|
87
|
+
| **goalSettings** (dict) : ``kpi`` (Enum ADD_TO_CART, APPLICATIONS, CHECKOUTS, CLICKS, CLICK_THROUGH_RATE, COMBINED_RETURN_ON_AD_SPEND, CONTACTS, COST_PER_ACTION, COST_PER_CLICK, COST_PER_CONVERSION_OFF_AMAZON, COST_PER_DETAIL_PAGE_VIEW, COST_PER_FIRST_APP_OPEN, COST_PER_INSTALL, COST_PER_SIGN_UP, COST_PER_UNSKIPPED_IMPRESSION, COST_PER_VIDEO_COMPLETION, DETAIL_PAGE_VIEW_RATE, FREQUENCY_AVERAGE, LEADS, OTHER, PAGE_VIEWS, PURCHASES, REACH, RETURN_ON_AD_SPEND, ROAS, ROAS_COMBINED, ROAS_OFF_AMAZON, ROAS_PROMOTED, SEARCH, SIGN_UP, SUBSCRIBE, TOP_OF_SEARCH_IMPRESSION_SHARE, TOTAL_RETURN_ON_AD_SPEND, VIDEO_COMPLETION_RATE)
|
|
88
|
+
| **pacing** (dict) [optional]
|
|
89
|
+
| **deliveryProfile** (string) : [required] Enum [ ASAP, EVEN, PACE_AHEAD ]
|
|
90
|
+
| **targetingSettings** (dict) [optional]
|
|
91
|
+
| **amazonViewability** (dict) : [required in this object]
|
|
92
|
+
| **includeUnmeasurableImpressions** (boolean) : [required]
|
|
93
|
+
| **viewabilityTier** (string) : [required] Enum [ ALL_TIERS, GREATER_THAN_40_PERCENT, GREATER_THAN_50_PERCENT, GREATER_THAN_60_PERCENT, GREATER_THAN_70_PERCENT, LESS_THAN_40_PERCENT ]
|
|
94
|
+
| **automatedTargetingTactic** (string) : Enum [ AWARENESS, CUSTOMER_ACQUISITION, MAXIMIZE_PERFORMANCE, PROSPECTING, REMARKETING, RETENTION, SEARCH ]
|
|
95
|
+
| **defaultAudienceTargetingMatchType** (string) : Enum [ EXACT, SIMILAR ]
|
|
96
|
+
| **enableLanguageTargeting** (boolean)
|
|
97
|
+
| **tacticsConvertersExclusionType** (string) : Enum [ NO_EXCLUSION, RECENT_CONVERTERS ]
|
|
98
|
+
| **targetedPGDealId** (string)
|
|
99
|
+
| **timeZoneType** (string) : Enum [ ADVERTISER_REGION, VIEWER ]
|
|
100
|
+
| **userLocationSignal** (string) : Enum [ CURRENT, MULTIPLE_SIGNALS ]
|
|
101
|
+
| **videoCompletionTier** (string) : Enum [ ALL_TIERS, GREATER_THAN_10_PERCENT, GREATER_THAN_20_PERCENT, GREATER_THAN_30_PERCENT, GREATER_THAN_40_PERCENT, GREATER_THAN_50_PERCENT, GREATER_THAN_60_PERCENT, GREATER_THAN_70_PERCENT, GREATER_THAN_80_PERCENT, GREATER_THAN_90_PERCENT ]
|
|
102
|
+
| **adSettings** (dict) [optional]
|
|
103
|
+
| **productAttributeSetRefinementConfigurationId** (string)
|
|
104
|
+
| **advertisedProductCategoryIds** (list<string>) [optional]
|
|
105
|
+
| **creativeRotationType** (string) : Enum [ RANDOM, WEIGHTED ]
|
|
106
|
+
| **creativeType** (string) : Enum [ IMAGE, VIDEO ]
|
|
107
|
+
| **inventoryType** (string) : Enum [ AAP_MOBILE_APP, AMAZON_MOBILE_DISPLAY, AUDIO, AUDIO_AMAZON_DEAL, DISPLAY, LIVE_EVENTS, ONLINE_VIDEO, PODCAST, STANDARD_DISPLAY, STREAMING_TV, STREAMING_TV_AMAZON_DEAL, VIDEO ]
|
|
108
|
+
| **marketplaceScope** (string) : Enum [ GLOBAL, SINGLE_MARKETPLACE ]
|
|
109
|
+
| **marketplaces** (list<dict>) : Marketplaces where the ad group runs
|
|
110
|
+
| **marketplaceConfigurations** (list<dict>) : Each with **marketplace** and **overrides** (both required)
|
|
111
|
+
| **startDateTime** (string) : Start date and time
|
|
112
|
+
| **endDateTime** (string) : End date and time
|
|
113
|
+
| **fees** (list<dict>) : Each with **addToBudgetSpentAmount**, **feeType**, **feeValue**, **thirdPartyProvider** (all required)
|
|
114
|
+
| **frequencies** (list<dict>) : Frequency cap definitions
|
|
115
|
+
| **purchaseOrderNumber** (string)
|
|
116
|
+
| **retailerId** (string)
|
|
117
|
+
| **tags** (list<dict>) : Each with **key** and **value** (both required)
|
|
118
|
+
|
|
119
|
+
Headers
|
|
120
|
+
| **Amazon-Ads-AccountId** (string) [optional] Advertiser account identifier
|
|
121
|
+
|
|
122
|
+
Returns
|
|
123
|
+
ApiResponse
|
|
124
|
+
| **207** MultiStatus response with partial errors. Inspect the payload
|
|
125
|
+
to know which ad groups were created and which failed.
|
|
126
|
+
|
|
127
|
+
"""
|
|
128
|
+
schema_version = 'application/json'
|
|
129
|
+
headers = {"Accept": schema_version, "Content-Type": schema_version}
|
|
130
|
+
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
|
|
131
|
+
|
|
132
|
+
@sp_endpoint('/adsApi/v1/update/adGroups', method='POST')
|
|
133
|
+
def update_ad_groups(self, **kwargs) -> ApiResponse:
|
|
134
|
+
r"""
|
|
135
|
+
update_ad_groups(body: dict) -> ApiResponse
|
|
136
|
+
|
|
137
|
+
Amazon Ads API v1 - Update Ad Groups (operationId: UpdateAdGroup)
|
|
138
|
+
|
|
139
|
+
Request Body [Required]
|
|
140
|
+
| **adGroups** (list<dict>) : [required] One or more ad group objects.
|
|
141
|
+
Each object requires **adGroupId** and may include any of the fields below.
|
|
142
|
+
|
|
143
|
+
Ad group fields [optional except adGroupId]
|
|
144
|
+
| **adGroupId** (string) : [required] The identifier of the ad group to update.
|
|
145
|
+
| **adProduct** (string) : Enum [ AMAZON_DSP, SPONSORED_BRANDS, SPONSORED_DISPLAY, SPONSORED_PRODUCTS, SPONSORED_TELEVISION ]
|
|
146
|
+
| **name** (string) : Name of the ad group
|
|
147
|
+
| **state** (string) : Enum [ DRAFT, ENABLED, PAUSED ]
|
|
148
|
+
| **bid** (dict) : ``baseBid``, ``defaultBid``, ``maxAverageBid``, ``marketplaceSettings``
|
|
149
|
+
| **budgets** (list<dict>) : Same shape as in create
|
|
150
|
+
| **optimization** (dict) : ``bidStrategy``, ``budgetSettings``, ``goalSettings``
|
|
151
|
+
| **pacing** (dict) : ``deliveryProfile`` Enum [ ASAP, EVEN, PACE_AHEAD ]
|
|
152
|
+
| **targetingSettings** (dict) : ``amazonViewability``, ``defaultAudienceTargetingMatchType``, ``enableLanguageTargeting``, ``tacticsConvertersExclusionType``, ``targetedPGDealId``, ``timeZoneType``, ``userLocationSignal``, ``videoCompletionTier``
|
|
153
|
+
| **adSettings** (dict) : ``productAttributeSetRefinementConfigurationId``
|
|
154
|
+
| **advertisedProductCategoryIds** (list<string>)
|
|
155
|
+
| **creativeRotationType** (string) : Enum [ RANDOM, WEIGHTED ]
|
|
156
|
+
| **creativeType** (string) : Enum [ IMAGE, VIDEO ]
|
|
157
|
+
| **marketplaceScope** (string) : Enum [ GLOBAL, SINGLE_MARKETPLACE ]
|
|
158
|
+
| **marketplaces** (list<dict>)
|
|
159
|
+
| **marketplaceConfigurations** (list<dict>)
|
|
160
|
+
| **startDateTime** (string)
|
|
161
|
+
| **endDateTime** (string)
|
|
162
|
+
| **fees** (list<dict>)
|
|
163
|
+
| **frequencies** (list<dict>)
|
|
164
|
+
| **purchaseOrderNumber** (string)
|
|
165
|
+
| **tags** (list<dict>)
|
|
166
|
+
|
|
167
|
+
Headers
|
|
168
|
+
| **Amazon-Ads-AccountId** (string) [optional] Advertiser account identifier
|
|
169
|
+
|
|
170
|
+
Returns
|
|
171
|
+
ApiResponse
|
|
172
|
+
| **207** MultiStatus response with partial errors. Inspect the payload
|
|
173
|
+
to know which ad groups were updated and which failed.
|
|
174
|
+
|
|
175
|
+
"""
|
|
176
|
+
schema_version = 'application/json'
|
|
177
|
+
headers = {"Accept": schema_version, "Content-Type": schema_version}
|
|
178
|
+
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
|
|
179
|
+
|
|
180
|
+
@sp_endpoint('/adsApi/v1/delete/adGroups', method='POST')
|
|
181
|
+
def delete_ad_groups(self, **kwargs) -> ApiResponse:
|
|
182
|
+
r"""
|
|
183
|
+
delete_ad_groups(body: dict) -> ApiResponse
|
|
184
|
+
|
|
185
|
+
Amazon Ads API v1 - Delete Ad Groups (operationId: DeleteAdGroup)
|
|
186
|
+
|
|
187
|
+
Request Body [Required]
|
|
188
|
+
| **adGroupIds** (list<string>) : [required] Ad group identifiers to delete
|
|
189
|
+
|
|
190
|
+
Headers
|
|
191
|
+
| **Amazon-Ads-AccountId** (string) [optional] Advertiser account identifier
|
|
192
|
+
|
|
193
|
+
Returns
|
|
194
|
+
ApiResponse
|
|
195
|
+
| **207** MultiStatus response with partial errors. Inspect the payload
|
|
196
|
+
to know which ad group ids succeeded and which failed.
|
|
197
|
+
|
|
198
|
+
"""
|
|
199
|
+
schema_version = 'application/json'
|
|
200
|
+
headers = {"Accept": schema_version, "Content-Type": schema_version}
|
|
201
|
+
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
from ad_api.base import Client, sp_endpoint, ApiResponse, Utils
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Campaigns(Client):
|
|
5
|
+
r"""
|
|
6
|
+
Campaigns(account='default', marketplace: Marketplaces = Marketplaces.EU, credentials=None, debug=False)
|
|
7
|
+
|
|
8
|
+
Amazon Ads API v1 - unified Campaigns endpoints
|
|
9
|
+
|
|
10
|
+
The v1 API is not split by product: every call goes to the same resource
|
|
11
|
+
(``/adsApi/v1/...``) and the product is selected in the request body via
|
|
12
|
+
``adProductFilter``.
|
|
13
|
+
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@sp_endpoint('/adsApi/v1/query/campaigns', method='POST')
|
|
18
|
+
def query_campaigns(self, **kwargs) -> ApiResponse:
|
|
19
|
+
r"""
|
|
20
|
+
query_campaigns(body: dict) -> ApiResponse
|
|
21
|
+
|
|
22
|
+
Amazon Ads API v1 - Query Campaigns (operationId: QueryCampaign)
|
|
23
|
+
|
|
24
|
+
Request Body [Required]
|
|
25
|
+
| **adProductFilter** (dict): [required]
|
|
26
|
+
| **include** (list<AdProduct>) : Enum [ AMAZON_DSP, SPONSORED_BRANDS, SPONSORED_DISPLAY, SPONSORED_PRODUCTS, SPONSORED_TELEVISION ]
|
|
27
|
+
| **campaignIdFilter** (dict) [optional]
|
|
28
|
+
| **include** (list<string>) : Campaign identifiers
|
|
29
|
+
| **goalFilter** (dict) [optional]
|
|
30
|
+
| **include** (list<Goal>) : Enum [ AWARENESS, CONSIDERATION, CONVERSIONS ]
|
|
31
|
+
| **marketplaceScopeFilter** (dict) [optional]
|
|
32
|
+
| **include** (list<MarketplaceScope>) : Enum [ GLOBAL, SINGLE_MARKETPLACE ]
|
|
33
|
+
| **nameFilter** (dict) [optional]
|
|
34
|
+
| **include** (list<string>) : Campaign names
|
|
35
|
+
| **queryTermMatchType** (string) : [required] Enum [ BROAD_MATCH, EXACT_MATCH ]
|
|
36
|
+
| **portfolioIdFilter** (dict) [optional]
|
|
37
|
+
| **include** (list<string>) : Portfolio identifiers
|
|
38
|
+
| **retailerScopeFilter** (dict) [optional]
|
|
39
|
+
| **include** (list<RetailerScope>) : Enum [ AMAZON, OTHER_RETAILERS ]
|
|
40
|
+
| **stateFilter** (dict) [optional]
|
|
41
|
+
| **include** (list<State>) : Enum [ ARCHIVED, DRAFT, ENABLED, PAUSED ]
|
|
42
|
+
| **maxResults** (int) [optional] Minimum 1, Maximum 1000
|
|
43
|
+
| **nextToken** (string) [optional] Token to navigate to the next page
|
|
44
|
+
|
|
45
|
+
Headers
|
|
46
|
+
| **Amazon-Ads-AccountId** (string) [optional] Advertiser account identifier
|
|
47
|
+
|
|
48
|
+
Returns
|
|
49
|
+
ApiResponse
|
|
50
|
+
| **campaigns** (list), **nextToken** (string)
|
|
51
|
+
|
|
52
|
+
"""
|
|
53
|
+
schema_version = 'application/json'
|
|
54
|
+
headers = {"Accept": schema_version, "Content-Type": schema_version}
|
|
55
|
+
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
|
|
56
|
+
|
|
57
|
+
@sp_endpoint('/adsApi/v1/delete/campaigns', method='POST')
|
|
58
|
+
def delete_campaigns(self, **kwargs) -> ApiResponse:
|
|
59
|
+
r"""
|
|
60
|
+
delete_campaigns(body: dict) -> ApiResponse
|
|
61
|
+
|
|
62
|
+
Amazon Ads API v1 - Delete Campaigns (operationId: DeleteCampaign)
|
|
63
|
+
|
|
64
|
+
Request Body [Required]
|
|
65
|
+
| **campaignIds** (list<string>) : [required] Campaign identifiers to delete
|
|
66
|
+
|
|
67
|
+
Headers
|
|
68
|
+
| **Amazon-Ads-AccountId** (string) [optional] Advertiser account identifier
|
|
69
|
+
|
|
70
|
+
Returns
|
|
71
|
+
ApiResponse
|
|
72
|
+
| **207** MultiStatus response with partial errors. Inspect the payload
|
|
73
|
+
to know which campaign ids succeeded and which failed.
|
|
74
|
+
|
|
75
|
+
"""
|
|
76
|
+
schema_version = 'application/json'
|
|
77
|
+
headers = {"Accept": schema_version, "Content-Type": schema_version}
|
|
78
|
+
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
|
|
79
|
+
|
|
80
|
+
@sp_endpoint('/adsApi/v1/update/campaigns', method='POST')
|
|
81
|
+
def update_campaigns(self, **kwargs) -> ApiResponse:
|
|
82
|
+
r"""
|
|
83
|
+
update_campaigns(body: dict) -> ApiResponse
|
|
84
|
+
|
|
85
|
+
Amazon Ads API v1 - Update Campaigns (operationId: UpdateCampaign)
|
|
86
|
+
|
|
87
|
+
Request Body [Required]
|
|
88
|
+
| **campaigns** (list<dict>) : [required] One or more campaign objects to update.
|
|
89
|
+
Each object requires **campaignId** and may include any of the fields below.
|
|
90
|
+
|
|
91
|
+
Campaign fields [optional except campaignId]
|
|
92
|
+
| **campaignId** (string) : [required] The identifier of the campaign to update.
|
|
93
|
+
| **adProduct** (string) : Enum [ AMAZON_DSP, SPONSORED_BRANDS, SPONSORED_DISPLAY, SPONSORED_PRODUCTS, SPONSORED_TELEVISION ]
|
|
94
|
+
| **name** (string) : The name of the campaign.
|
|
95
|
+
| **state** (string) : Enum [ DRAFT, ENABLED, PAUSED ]
|
|
96
|
+
| **budgets** (list<dict>) : Budget objects for the campaign.
|
|
97
|
+
| **startDateTime** (string) : Campaign start date and time.
|
|
98
|
+
| **endDateTime** (string) : Campaign end date and time.
|
|
99
|
+
| **portfolioId** (string) : The identifier of the portfolio.
|
|
100
|
+
| **purchaseOrderNumber** (string) : Advertiser purchase order number.
|
|
101
|
+
| **tags** (list<dict>) : Advertiser-specified custom identifiers.
|
|
102
|
+
| **marketplaces** (list<dict>) : Marketplaces where the campaign runs.
|
|
103
|
+
| **marketplaceConfigurations** (list<dict>) : Per-marketplace overrides.
|
|
104
|
+
| **countries** (list<string>) : Country codes.
|
|
105
|
+
| **costType** (string) : Enum [ CPC, CPM, FIXED_PRICE, VCPM ]
|
|
106
|
+
| **fees** (list<dict>) : Fee definitions.
|
|
107
|
+
| **flights** (list<dict>) : Flight schedules.
|
|
108
|
+
| **frequencies** (list<dict>) : Frequency cap definitions.
|
|
109
|
+
| **optimizations** (dict) : Campaign optimization settings.
|
|
110
|
+
| **siteRestrictions** (list<dict>) : Site restrictions.
|
|
111
|
+
| **skanAppId** (string) : SKAdNetwork app id.
|
|
112
|
+
| **targetedPGDealId** (string) : Targeted programmatic guaranteed deal id.
|
|
113
|
+
| **adomains** (list<string>) : Ad domains.
|
|
114
|
+
|
|
115
|
+
Headers
|
|
116
|
+
| **Amazon-Ads-AccountId** (string) [optional] Advertiser account identifier
|
|
117
|
+
|
|
118
|
+
Returns
|
|
119
|
+
ApiResponse
|
|
120
|
+
| **207** MultiStatus response with partial errors. Inspect the payload
|
|
121
|
+
to know which campaigns succeeded and which failed.
|
|
122
|
+
|
|
123
|
+
"""
|
|
124
|
+
schema_version = 'application/json'
|
|
125
|
+
headers = {"Accept": schema_version, "Content-Type": schema_version}
|
|
126
|
+
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
|
|
127
|
+
|
|
128
|
+
@sp_endpoint('/adsApi/v1/create/campaigns', method='POST')
|
|
129
|
+
def create_campaigns(self, **kwargs) -> ApiResponse:
|
|
130
|
+
r"""
|
|
131
|
+
create_campaigns(body: dict) -> ApiResponse
|
|
132
|
+
|
|
133
|
+
Amazon Ads API v1 - Create Campaigns (operationId: CreateCampaign)
|
|
134
|
+
|
|
135
|
+
Request Body [Required]
|
|
136
|
+
| **campaigns** (list<dict>) : [required] One or more campaign objects to create.
|
|
137
|
+
Each object requires **adProduct**, **name** and **state**.
|
|
138
|
+
|
|
139
|
+
Campaign fields
|
|
140
|
+
| **adProduct** (string) : [required] Enum [ AMAZON_DSP, SPONSORED_BRANDS, SPONSORED_DISPLAY, SPONSORED_PRODUCTS, SPONSORED_TELEVISION ]
|
|
141
|
+
| **name** (string) : [required] The name of the campaign.
|
|
142
|
+
| **state** (string) : [required] Enum [ DRAFT, ENABLED, PAUSED ]
|
|
143
|
+
| **budgets** (list<dict>) : Budget objects for the campaign.
|
|
144
|
+
| **budgetType** (string) : [required] Budget type.
|
|
145
|
+
| **budgetValue** (dict) : [required] Budget amount.
|
|
146
|
+
| **recurrenceTimePeriod** (string) : [required] Recurrence period.
|
|
147
|
+
| **startDateTime** (string) : Campaign start date and time.
|
|
148
|
+
| **endDateTime** (string) : Campaign end date and time.
|
|
149
|
+
| **portfolioId** (string) : The identifier of the portfolio.
|
|
150
|
+
| **purchaseOrderNumber** (string) : Advertiser purchase order number.
|
|
151
|
+
| **tags** (list<dict>) : [required key+value] Advertiser-specified custom identifiers.
|
|
152
|
+
| **marketplaces** (list<dict>) : Marketplaces where the campaign runs.
|
|
153
|
+
| **marketplaceConfigurations** (list<dict>) : Per-marketplace overrides, each with
|
|
154
|
+
**marketplace** and **overrides** (both required).
|
|
155
|
+
| **countries** (list<string>) : Country codes.
|
|
156
|
+
| **costType** (string) : Enum [ CPC, CPM, FIXED_PRICE, VCPM ]
|
|
157
|
+
| **fees** (list<dict>) : [required feeType+feeValue+feeValueType] Fee definitions.
|
|
158
|
+
| **flights** (list<dict>) : [required budget+startDateTime+endDateTime] Flight schedules.
|
|
159
|
+
| **frequencies** (list<dict>) : [required eventMaxCount+frequencyTargetingSetting+
|
|
160
|
+
timeCount+timeUnit] Frequency cap definitions.
|
|
161
|
+
| **optimizations** (dict) : Campaign optimization settings.
|
|
162
|
+
| **siteRestrictions** (list<dict>) : Site restrictions.
|
|
163
|
+
| **brandId** (string) : Brand identifier.
|
|
164
|
+
| **skanAppId** (string) : SKAdNetwork app id.
|
|
165
|
+
| **targetedPGDealId** (string) : Targeted programmatic guaranteed deal id.
|
|
166
|
+
| **adomains** (list<string>) : Ad domains.
|
|
167
|
+
| **autoCreationSettings** (dict) : Automatic creation settings.
|
|
168
|
+
|
|
169
|
+
Headers
|
|
170
|
+
| **Amazon-Ads-AccountId** (string) [optional] Advertiser account identifier
|
|
171
|
+
|
|
172
|
+
Returns
|
|
173
|
+
ApiResponse
|
|
174
|
+
| **207** MultiStatus response with partial errors. Inspect the payload
|
|
175
|
+
to know which campaigns were created and which failed.
|
|
176
|
+
|
|
177
|
+
"""
|
|
178
|
+
schema_version = 'application/json'
|
|
179
|
+
headers = {"Accept": schema_version, "Content-Type": schema_version}
|
|
180
|
+
return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
|
ad_api/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.0.
|
|
1
|
+
__version__ = "1.0.1"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
ad_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
ad_api/version.py,sha256=
|
|
2
|
+
ad_api/version.py,sha256=d4QHYmS_30j0hPN8NmNPnQ_Z0TphDRbu4MtQj9cT9e8,22
|
|
3
3
|
ad_api/api/__init__.py,sha256=E9c0ZyK4vplMlKKEBF8CV5u7P4uSkTMSQsAuSQu5bfY,1514
|
|
4
4
|
ad_api/api/account.py,sha256=CmOvCfHoPWaeTUJvtB0pNoNulZVSz4oMMCKIpVTpHos,2931
|
|
5
5
|
ad_api/api/advertising_test_account.py,sha256=btOVbdk2tBDmyKSJaQbcIFyzNG8KFJVUmTe4p9xMhpU,1507
|
|
@@ -103,6 +103,9 @@ ad_api/api/sp/reports.py,sha256=OMNHL86doMZpbcLixIN1GLf6Mtm_KRxxxs6_vuzMLbU,5381
|
|
|
103
103
|
ad_api/api/sp/schedule_based_bid_optimization.py,sha256=G8VkS7iP1lTIAxZgbfRCLz8njw1DkVH9HQPOZ63pWNU,2371
|
|
104
104
|
ad_api/api/sp/snapshots.py,sha256=Pl72FpsTRhgA-FQYapTCAqhKLioUMn_Bdru502TS_RE,2969
|
|
105
105
|
ad_api/api/sp/suggested_keywords.py,sha256=cmE8W6q9bIBVt9Zuy1bZKOWErvcIuOyCt8-XAgrhnu8,3553
|
|
106
|
+
ad_api/api/v1/__init__.py,sha256=cm5OiA9-C0GGZZweFtJSRmwICMJqmvx8jHa6whHUEYc,113
|
|
107
|
+
ad_api/api/v1/ad_groups.py,sha256=pQhCVdve_O6kbL4mBA5bxxhKcKNl_BKqa7z9DvrxwaM,12626
|
|
108
|
+
ad_api/api/v1/campaigns.py,sha256=u5PlvoAhgVhMxbCvYkPgqtbYK3TXXcb7TMie0Qjrgwc,9573
|
|
106
109
|
ad_api/auth/__init__.py,sha256=B_yKdmsHENQaKfMFAIcSxQqG4aBUmNBm5orKIMUYObk,229
|
|
107
110
|
ad_api/auth/access_token_client.py,sha256=_V0FGXRmqRNMb1fz1AGqnR6gYr_WqFkMTbK1os0yoIk,2983
|
|
108
111
|
ad_api/auth/access_token_response.py,sha256=zlkfo3oWjkhAqNJIUOM0S4g_FvpgDa3IwNLxlREM89A,275
|
|
@@ -118,8 +121,8 @@ ad_api/base/exceptions.py,sha256=9D3M40ZIlLS0fA-aQh1BTWPOW-Nvf0tRhbA85jFnDJ4,438
|
|
|
118
121
|
ad_api/base/helpers.py,sha256=naUkDLK466x_OBCPXxMlzRc2nPC6iQ6H_vyUji0MJJ0,2282
|
|
119
122
|
ad_api/base/marketplaces.py,sha256=44lvCcluXNpqTprWQ80e3weSQmQbJoWL-WDSOWVbCyQ,4657
|
|
120
123
|
ad_api/base/utils.py,sha256=_qnCBOvyJTLgaZjJzUWTi38GGLHkQszXELs79133Rb4,5618
|
|
121
|
-
python_amazon_ad_api-1.0.
|
|
122
|
-
python_amazon_ad_api-1.0.
|
|
123
|
-
python_amazon_ad_api-1.0.
|
|
124
|
-
python_amazon_ad_api-1.0.
|
|
125
|
-
python_amazon_ad_api-1.0.
|
|
124
|
+
python_amazon_ad_api-1.0.1.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
|
|
125
|
+
python_amazon_ad_api-1.0.1.dist-info/METADATA,sha256=JnL3S_-0jilHP0OqdJlnmKideMkHedRNTzJvh98rBxk,20577
|
|
126
|
+
python_amazon_ad_api-1.0.1.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
127
|
+
python_amazon_ad_api-1.0.1.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
|
|
128
|
+
python_amazon_ad_api-1.0.1.dist-info/RECORD,,
|
|
File without changes
|
{python_amazon_ad_api-1.0.0.dist-info → python_amazon_ad_api-1.0.1.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|