### Sample Request to List Workflows Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/amazon-marketing-cloud/reporting/create-workflow.md Example using curl to make a GET request to list all workflows, including necessary authorization and client headers. ```bash curl --location 'https://advertising-api.amazon.com/amc/reporting/{instanceId}/workflows' \ --header 'Authorization: Bearer XXXXXX \ --header 'Amazon-Advertising-API-ClientID: amzn1.application-oa2-client.XXXXX' \ --header 'Amazon-Advertising-API-AdvertiserId: XXXXXX' \ --header 'Amazon-Advertising-API-MarketplaceId: ATVPDKIKX0DER' ``` -------------------------------- ### Date Range Example Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/media-planning/reach-forecasting/get-started.md Example of how to specify the start and end dates for the forecast period. ```json "startDate": "2026-01-01", "endDate": "2026-01-15" ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/get-started/generate-sdk.md Run this command in your terminal to install all the necessary dependencies listed in your package.json file before building the client. ```bash npm install ``` -------------------------------- ### Connected Devices Supply Package Examples Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/media-planning/reach-forecasting/get-started.md Examples of specifying multiple supply packages for Connected Devices targeting. ```json "supplyPackage": ["DSP_FIRE_TV"] ``` ```json "supplyPackage": ["DSP_FIRE_TABLET", "DSP_ALEXA_DISPLAY", "DSP_FIRE_TABLET"] ``` ```json "supplyPackage": ["DSP_FIRE_TV_FIRE_TABLET_ALEXA_DISPLAY"] ``` -------------------------------- ### Example Landing Page URL Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/amazon-attribution/how-to.md This is an example of a landing page URL that a campaign will drive to, before macro replacement. ```bash https://www.amazon.com/AmazonBasics-Performance-Alkaline-Batteries-Count/dp/B00MNV8E0C ``` -------------------------------- ### STV+ Supply Package Examples Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/media-planning/reach-forecasting/get-started.md Examples of specifying multiple supply packages for STV+ targeting. ```json "supplyPackage": ["DSP_STREAMING_TV"] ``` ```json "supplyPackage": ["DSP_STREAMING_TV", "DSP_TWITCH_VIDEO"] ``` ```json "supplyPackage": ["DSP_STREAMING_TV", "DSP_PRIME_VIDEO"] ``` ```json "supplyPackage": ["DSP_STREAMING_TV", "DSP_TWITCH_VIDEO", "DSP_PRIME_VIDEO"] ``` -------------------------------- ### Example Authorization URL Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/get-started/create-authorization-grant.md An example of a fully constructed authorization URL using specific client ID and return URL values. ```shell https://www.amazon.com/ap/oa \ ?client_id=amzn1.application-oa2-client.12345678901234567890 \ &scope=advertising::campaign_management \ &response_type=code \ &redirect_uri=https://amazon.com ``` -------------------------------- ### Single Supply Package Example Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/media-planning/reach-forecasting/get-started.md Example of specifying a single supply package for targeting. ```json "supplyPackage": ["SPONSORED_PRODUCTS"] ``` -------------------------------- ### Example Store List Response Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/reference/2/stores.md This is an example of a successful response when listing stores. It includes store details and associated page information. ```json [ { "code": "SUCCESS", "entityId": "ENTITY6SICSOL71XVX", "storeName": "Test 1", "brandEntityId": "ENTITY6SICSOL71XVX", "storePageInfo": [ { "storePageId": "75233FD4-DC27-4D39-A3AE-2DDBEE144AD2", "storePageUrl": "https://www.amazon.com/stores/page/75233FD4-DC27-4D39-A3AE-2DDBEE144AD2", "storePageName": "Home" }, { "storePageId ": "75233FD4-DC27-4D39-A3AE-2DDBEE144AD3", "storePageUrl ": " https://www.amazon.com/stores/page/75233FD4-DC27-4D39-A3AE-2DDBEE144AD3", "storePageName ": "Subpage title" } ] } ] ``` -------------------------------- ### Set Up Client Package and Link Library Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/get-started/generate-sdk.md Initialize the client directory as an NPM package, create the 'src' subdirectory, and link the locally built client library. ```bash # set up client package cd ../amazon-ads-client-demo npm init -y npm link amazon-ads-library-demo # makes client library import available locally mkdir src ``` -------------------------------- ### Example Confirmation Response from SubscribeURL Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/amazon-marketing-stream/onboarding/sqs/get-started.md This is an example of the XML response you might receive after making a GET request to the SubscribeURL. It indicates a successful subscription confirmation. ```xml arn:aws:sns:us-east-2:123456789012:MyTopic:1234a567-bc89-012d-3e45-6fg7h890123i abcd1efg-23hi-jkl4-m5no-p67q8rstuvw9 ``` -------------------------------- ### Install Dependencies and Link Library Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/get-started/generate-sdk.md Run these commands to install project dependencies and create a local link for the client library, making it available to the client package. ```bash npm install npm link ``` -------------------------------- ### Get Keyword Recommendations with ASINs Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/sponsored-brands/targeting/keyword-targeting.md Use this endpoint to get keyword recommendations for Sponsored Brands campaigns by providing a list of ASINs and creative parameters. This example shows how to request recommendations without specifying a locale. ```curl curl --location 'https://advertising-api.amazon.com/sb/recommendations/keyword' \ --header 'Amazon-Advertising-API-ClientId: amzn1.application-oa2-client.`xxxxxxxx`' \ --header 'Authorization: Bearer `xxxxxxxx`' \ --header 'Amazon-Advertising-API-Scope: `xxxxxxxx`' \ --header 'Content-Type: application/json' \ --data '{ \ { \ "asins":[ \ "B00J000000", \ "B0787FTYUO", \ "B004000000" \ ], \ "maxNumSuggestions":"3", \ "creativeType":"PRODUCT_COLLECTION", \ "creativeAsins":[ \ "B00JVTNWB0", \ "B0787FVB5F", \ "B004QF0TFQ" \ ], \ "locale":"zh_CN" \ } \ }' ``` -------------------------------- ### Set Up Model and Bounds Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/amazon-marketing-cloud/playbooks/media_performance_optimization.md Initializes a model, sets parameter hints with values and bounds, and prepares parameters for fitting. This is used to define the constraints for curve fitting. ```python abc = abc_model() abc.set_param_hint("a", value=10, min=5) abc.set_param_hint("b", value=10, min=1, max=10000000) abc.set_param_hint("c", value=-100, min=-150, max=-50) params = abc.make_params() ``` -------------------------------- ### Get Sponsored Brands Campaign Details Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/rules/budget-rules/campaigns-api.md Example endpoint to retrieve details for a Sponsored Brands campaign, which may include budget rule information. ```bash GET /sb/campaigns/{campaignId} ``` -------------------------------- ### Initialize client library package Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/get-started/generate-sdk.md Initializes the client library directory as an NPM package and creates required subdirectories. ```bash # set up client library package cd amazon-ads-library-demo npm init -y mkdir input mkdir scripts ``` -------------------------------- ### Setup Root Files Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/get-started/generate-sdk.md Copies the runtime.ts file to the root generated directory and creates a root index.ts file. The root index.ts exports the runtime and includes exports for each ad product, ensuring proper import paths. ```typescript // Final root file setup for proper imports function setupRootFiles(adProducts: string[]) { // Copy runtime.ts to root generated directory const v1RuntimePath = path.join(V1_DIR, 'runtime.ts'); const rootRuntimePath = path.join(GENERATED_DIR, 'runtime.ts'); if (fs.existsSync(v1RuntimePath)) { fs.copyFileSync(v1RuntimePath, rootRuntimePath); console.log('Copied runtime.ts to root and removed from v1'); } // Create root index.ts const rootIndexPath = path.join(GENERATED_DIR, 'index.ts'); let rootIndexContent = `// Auto-generated root index file\n\n`; rootIndexContent += `export * from './runtime.js';\n`; // Sort products to ensure consistent order const sortedProducts = [...adProducts].sort((a, b) => { // Put 'ALL' related export last if (a.toLowerCase() === 'all') return 1; if (b.toLowerCase() === 'all') return -1; return a.localeCompare(b); }); // Add exports for each product sortedProducts.forEach(product => { if (product.toLowerCase() === 'all') { rootIndexContent += `export * as v1 from './v1/index.js';\n`; } else { const exportName = `v1_${product.toLowerCase()}`; rootIndexContent += `export * as ${exportName} from './v1/${product.toLowerCase()}/index.js';\n`; } }); fs.writeFileSync(rootIndexPath, rootIndexContent); console.log('Created root index.ts'); // Update v1/index.ts to only export models and apis const v1IndexPath = path.join(V1_DIR, 'index.ts'); const v1IndexContent = `// Auto-generated v1 index file\n\n` + `export * from './models/index.js';\n` + `export * from './apis/index.js';\n`; fs.writeFileSync(v1IndexPath, v1IndexContent); console.log('Updated v1/index.ts'); } ``` -------------------------------- ### Manager Account Advertiser IDs Response Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/reporting/dsp/reporting-by-account-type.md This is an example response from the `GET /managerAccounts` endpoint. The `dspAdvertiserId` values from this response can be used as the `accountId` for creating DSP reports. ```json { "managerAccounts": [ { "linkedAccounts": [ { "accountId": "ENTITY3G3R4D4E0FEIV", "accountName": "ADVERTISER_NAME_456", "accountType": "DSP_ADVERTISING_ACCOUNT", "dspAdvertiserId": "12345678", "marketplaceId": "ATVPDKIKX0DER", "profileId": "" }, { "accountId": "ENTITY147ELY1DV9VO0", "accountName": "ADVERTISER_NAME_123", "accountType": "DSP_ADVERTISING_ACCOUNT", "dspAdvertiserId": "98765432", "marketplaceId": "ATVPDKIKX0DER", "profileId": "" } ], "managerAccountId": "amzn1.ads1.ma1.7xxxxxxxxxxx", "managerAccountName": "Test Agency" } ] } ``` -------------------------------- ### Python Example: Maximize Clicks with Budget Constraints Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/amazon-marketing-cloud/playbooks/media_performance_optimization.md Sets up parameters and initial conditions for maximizing clicks within a total budget and a specific constraint on 'Super Power Batteries Brand' allocation. This code initializes variables, defines bounds, and prepares arguments for the optimization functions. ```python # Total budget constraint total_budget = 20000 adv_allocation = 20000 search_value = ['Super Power Batteries'] Nfeval = 1 x = np.array([]) # Initial guess for allocations (you can adjust this based on your problem) initial_allocations = np.ones(len(observations)) / len(observations) * total_budget # Define bounds for allocations (optional but can be useful) bounds = [(0, total_budget) for _ in observations] # Each allocation should be between 0 and 1 # Setup args for the objective function args = (a, b, c, observations) ``` -------------------------------- ### View Workflow Executions Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/amazon-marketing-cloud/reporting/execute-workflow.md Use this GET request to retrieve details for all workflow executions within a specific instance. No specific setup is required beyond having an instance ID. ```http GET /amc/reporting/{instanceId}/workflowExecutions/ ``` -------------------------------- ### Get Profile Information Response Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/sponsored-display/creatives.md This is an example response when retrieving profile information. It includes details like profile ID, country code, currency, daily budget, timezone, and account information. ```bash [ { "profileId": 1234567890, "countryCode": "US", "currencyCode": "USD", "dailyBudget": 9.99999999E8, "timezone": "America/Los_Angeles", "accountInfo": { "marketplaceStringId": "ATVPDKIKX0DER", "id": "A123567900", "type": "seller", "name": "Ad Expresso" } } ] ``` -------------------------------- ### Fetch Top-Level Taxonomy Categories Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/sponsored-display/audience-targeting.md Use this request to start browsing the Amazon audiences catalog hierarchy. Provide an empty categoryPath to get top-level categories. Ensure correct API credentials are used. ```json curl --location --request POST 'https://advertising-api.amazon.com/audiences/taxonomy/list' \ --header 'Amazon-Advertising-API-ClientId: amzn1.application-oa2-client.xxxxxx' \ --header 'Authorization: Bearer Atza|xxxxxx' \ --header 'Amazon-Advertising-API-Scope: xxxxxx' \ --header 'Content-Type: application/json' \ --data-raw '{ "adType": "SD", "categoryPath": [] }' ``` -------------------------------- ### Test the Client Application Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/get-started/generate-sdk.md Run this command to execute the built client application and test its functionality. ```bash npm run start ``` -------------------------------- ### Example Budget Configuration Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/global/global-getting-started.md This snippet shows how to configure country-specific monetary budgets for advertising campaigns. ```json { "value": "ENABLED" }, "budgetCaps": { "countryMonetaryBudgetSetting": { "US" : { "value": 30 }, "UK": { "value": 45 }, "JP": { "value": 120 } } } } ] } ``` -------------------------------- ### List Sponsored Display Campaigns (cURL) Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/get-started/first-call.md This example shows a GET Sponsored Display campaigns request using the North America URL prefix. Ensure you replace placeholders with your actual Client ID, Scope, and Authorization token. ```bash curl --location --request GET 'https://advertising-api.amazon.com/sd/campaigns' \ --header 'Amazon-Advertising-API-ClientId: amzn1.application-oa2-client.xxxxxxxxxx' \ --header 'Amazon-Advertising-API-Scope: xxxxxxxxx' \ --header 'Authorization: Bearer xxxxxxxxxxxx' ``` -------------------------------- ### Get Moderation Status for Ad Creative Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/sponsored-display/non-amazon-sellers/get-started.md Use the GET /sd/creatives API to retrieve the moderation status of an ad creative. This API can filter by `creativeId` to get results for a specific creative or by `adGroupId` to get the status for all creatives within an ad group. ```APIDOC ## GET /sd/creatives ### Description Retrieves the moderation status of an ad creative or all creatives within an ad group. ### Method GET ### Endpoint https://advertising-api.amazon.com/sd/creatives ### Parameters #### Query Parameters - **language** (string) - Optional - The language for the response, e.g., "en-US". - **creativeIdFilter** (string) - Optional - Filter by a specific creative ID. - **adGroupId** (string) - Optional - Filter by ad group ID to get status for all creatives in that group. ### Request Example (with creative ID) ```bash curl --location --request GET 'https://advertising-api.amazon.com/sd/creatives?language=en-US&creativeIdFilter=354572625772967' --header 'Amazon-Advertising-API-ClientId: amzn1.application-oa2-client.xxxxxx' --header 'Amazon-Advertising-API-Scope: xxxxxx' --header 'Accept: application/json' --header 'Authorization: Bearer Atza|xxxxxx' ``` ### Response #### Success Response (200) - Returns an array of creative moderation statuses. - **creativeId** (string) - The ID of the creative. - **moderationStatus** (string) - The moderation status (e.g., "APPROVED"). - **etaForModeration** (string) - Estimated time for moderation (if applicable). - **policyViolations** (array) - List of policy violations if rejected. #### Response Example (Approved) ```json [ { "creativeId": 869892967981643111, "moderationStatus": "APPROVED", "etaForModeration": null, "policyViolations": [] } ] ``` ``` -------------------------------- ### Set up workspace directory Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/get-started/generate-sdk.md Creates a workspace directory and subdirectories for the Amazon Ads API client library demo. ```bash cd ~/Desktop # choose a different parent directory if desired mkdir amazon-ads-workspace cd amazon-ads-workspace mkdir packages cd packages mkdir amazon-ads-library-demo mkdir amazon-ads-client-demo ``` -------------------------------- ### Get an account Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/account-management/accounts/retrieve-accounts.md Call to get a single account given its ID. ```APIDOC ## Get an account ### Description Call to get a single account given its ID. ### Method GET ### Endpoint /adsAccounts/{accountId} ### Request Example GET /adsAccounts/amzn1.ads-account.g.87rerlyohs3b1cmj2rem03xmd ### Response #### Success Response (200) - **adsAccount** (object) - Details of the ads account. - **adsAccountId** (string) - The unique identifier for the ads account. - **accountName** (string) - The name of the ads account. - **status** (string) - The current status of the ads account (e.g., CREATED, PARTIALLY_CREATED, PENDING, DISABLED). - **countryCodes** (array) - A list of country codes associated with the account. - **alternateIds** (array) - A list of alternate identifiers, including profile IDs and entity IDs for different countries. ### Response Example ```json { "adsAccount": { "adsAccountId": "amzn1.ads-account.g.87rerlyohs3b1cmj2rem03xmd", "accountName": "My Ads Account Name", "status": "CREATED", "countryCodes": [ "UK", "US" ], "alternateIds": [ { "profileId": 123123, "countryCode": "US" }, { "entityId": "ENTITY215J8KS99D", "countryCode": "US" }, { "profileId": 456456, "countryCode": "UK" }, { "entityId": "ENTITY99H739IY0R", "countryCode": "UK" } ] } } ``` ``` -------------------------------- ### Delivery Type Example Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/media-planning/reach-forecasting/get-started.md Example of specifying the delivery type for the reach forecast. ```json "deliveryType": "GUARANTEED" ``` -------------------------------- ### Keyword Targeting Example Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/media-planning/reach-forecasting/get-started.md Demonstrates how to set up keyword targeting for advertising campaigns. Ensure bid information and product targeting are included. Supported for SPONSORED_PRODUCTS, SPONSORED_BRANDS, and SPONSORED_BRANDS_VIDEO supplies. ```json { "negative": false, "bid": { "bid": 0.75, "currencyCode": "USD" }, "targetDetails": { "keywordTarget": { "targetType": "KEYWORD", "keyword": "AirPods Pro 2", "matchType": "PHRASE" } } } ``` ```json { "negative": false, "targetDetails": { "productTarget": { "targetType": "PRODUCT", "asin": "B0D1XD1ZV3" } } } ``` -------------------------------- ### Country Code Example Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/media-planning/reach-forecasting/get-started.md Example of how to specify the country code for a reach forecast. ```json "countryCode": "US" ``` -------------------------------- ### Search Assets with GET /assets Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/creative-asset/managing-assets.md Retrieves a single asset by its assetId using a GET request. ```APIDOC ## GET /assets ### Description Returns a single asset based on an `assetId` query parameter. ### Method GET ### Endpoint /assets ### Parameters #### Query Parameters - **assetId** (string) - Required - The ID of the asset to retrieve. ``` -------------------------------- ### Create Keywords (Standard) Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/sponsored-products/keywords/overview.md This example demonstrates how to create keywords using the standard request body structure. It includes the necessary headers and a sample request body. ```APIDOC ## POST https://advertising-api.amazon.com/sp/keywords ### Description Creates Sponsored Products keywords. This is the standard method without specifying native language details. ### Method POST ### Endpoint https://advertising-api.amazon.com/sp/keywords ### Headers - **Amazon-Advertising-API-ClientId** (string) - Required - Your application's Client ID. - **Authorization** (string) - Required - Bearer token for authentication. - **Amazon-Advertising-API-Scope** (string) - Required - Your advertiser ID. - **Prefer** (string) - Optional - `return=representation` to get the created resource in the response. - **Accept** (string) - Required - `application/vnd.spKeyword.v3+json`. - **Content-Type** (string) - Required - `application/vnd.spKeyword.v3+json`. ### Request Body - **keywords** (array) - Required - A list of keyword objects to create. - **campaignId** (string) - Required - The ID of the campaign. - **matchType** (string) - Required - The match type for the keyword (e.g., EXACT, BROAD, PHRASE). - **state** (string) - Required - The state of the keyword (e.g., ENABLED, PAUSED). - **bid** (number) - Required - The bid amount for the keyword. - **adGroupId** (string) - Required - The ID of the ad group. - **keywordText** (string) - Required - The text of the keyword. ### Request Example ```json { "keywords": [ { "campaignId": "153839444046652", "matchType": "EXACT", "state": "ENABLED", "bid": 0.02, "adGroupId": "208676741301789", "keywordText": "soap bar" } ] } ``` ### Response #### Success Response (200) - **keywords** (object) - Contains lists of successful and errored keyword creations. - **error** (array) - List of errors encountered during keyword creation. - **success** (array) - List of successfully created keywords. - **index** (integer) - The index of the keyword in the request array. - **keyword** (object) - Details of the created keyword. - **adGroupId** (string) - The ID of the ad group. - **bid** (number) - The bid amount. - **campaignId** (string) - The ID of the campaign. - **keywordId** (string) - The ID of the created keyword. - **keywordText** (string) - The text of the keyword. - **matchType** (string) - The match type. - **state** (string) - The state of the keyword. - **keywordId** (string) - The ID of the created keyword. #### Response Example ```json { "keywords": { "error": [], "success": [ { "index": 0, "keyword": { "adGroupId": "80908659241419", "bid": 0.02, "campaignId": "152865535357884", "keywordId": "104465559608285", "keywordText": "soap bar", "matchType": "EXACT", "state": "ENABLED" }, "keywordId": "104465559608285" } ] } } ``` ``` -------------------------------- ### Get User Deletion Request Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/amazon-marketing-cloud/advertiser-data-upload/advertiser-data-identity-deletion.md Gets status and metadata for a previously initiated identity deletion. ```APIDOC ## GET /amc/advertiserData/{instanceId}/userDeletionRequest/{userDeletionRequestId} ### Description Gets status and metadata for a previously initiated identity deletion. ### Method GET ### Endpoint /amc/advertiserData/{instanceId}/userDeletionRequest/{userDeletionRequestId} ``` -------------------------------- ### Example Click-Through URL with Macros Replaced Source: https://github.com/idealerror/amazon-ads-api-docs/blob/main/en-us/guides/amazon-attribution/how-to.md This is an example of the resulting click-through URL after the publisher dynamically replaces the macros with actual campaign values. ```bash https://www.amazon.com/AmazonBasics-Performance-Alkaline-Batteries-Count/dp/B00MNV8E0C?maas=maas_adg_api_123456789_macro_1_99&ref_=aa_maas&tag=maas&aa_campaignid=1234&aa_adgroupid=6789&aa_creativeid=ad-1357_kwd-123_dev-c_ext-2468 ```