Creates a new workflow. The request body is used as the definition for the new workflow. Workflows are defined as a set of operations that take previously defined data sources as input and use them to generate reports.
请求参数
Header 参数
Amazon-Advertising-API-ClientId
string
必需
(Required) The identifier of a client associated with an Amazon Developer account.
示例值:
{{client_id}}
Amazon-Advertising-API-MarketplaceId
string
必需
(Required) The marketplace identifier for the marketplace in the request. Marketplaces are tied to the country.
示例值:
{{marketplace_id}}
Amazon-Advertising-API-AdvertiserId
string
必需
(Required) The AMC account identifier. Your Amazon Ads account executive would have provided you this identifier when you onboarded AMC. Alternatively, access the AMC console with your user identifier and password, and grab the entity identifier value that is displayed in the URL. The alphanumeric code that is prefixed with ENTITY is your account identifier. An example of an entity identifier is: ENTITY1AA1AA11AAA1.
示例值:
{{advertiser_id}}
Authorization
string
必需
示例值:
Bearer {{access_token}}
Body 参数application/json
object{0}
示例
{"workflowId":"my-first-workflow0001","sqlQuery":"SELECT advertiser, campaign, sum(total_cost) as spend, sum(impressions) as impressions, count(DISTINCT user_id) as reach FROM dsp_impressions GROUP BY advertiser, campaign"},"timeWindowTimeZone":"UTC","timeWindowType":"MOST_RECENT_WEEK"}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl--location-g--request POST 'https://www.amazon.com/ap/oa/amc/reporting/{{instanceId}}/workflows' \
--header'Amazon-Advertising-API-ClientId: {{client_id}}' \
--header'Amazon-Advertising-API-MarketplaceId: {{marketplace_id}}' \
--header'Amazon-Advertising-API-AdvertiserId: {{advertiser_id}}' \
--header'Authorization: Bearer {{access_token}}' \
--header'Content-Type: application/json' \
--data-raw'{
"workflowId": "my-first-workflow0001",
"sqlQuery": "SELECT advertiser, campaign, sum(total_cost) as spend, sum(impressions) as impressions, count(DISTINCT user_id) as reach FROM dsp_impressions GROUP BY advertiser, campaign"
},
"timeWindowTimeZone": "UTC",
"timeWindowType": "MOST_RECENT_WEEK"
}'