### Install Dependencies and Run Development Server Source: https://advertising.amazon.com/API/docs/en-us/knowledge-hub/hands-on-workshops/workshop-gen-ai-langgraph-agents/08-chat-frontend Navigate to the chat frontend directory, install npm packages, and start the development server. Access the application at http://localhost:3000. ```bash cd ads-chat-nextjs npm install npm run dev ``` -------------------------------- ### Local MCP Server Setup and Test Source: https://advertising.amazon.com/API/docs/en-us/knowledge-hub/hands-on-workshops/workshop-gen-ai-langgraph-agents/02-mcp-server Install dependencies, set environment variables for credentials (for local testing only), and start the MCP server. Test the server using curl. ```bash cd custom-ads-mcp pip install -r requirements.txt # Set credentials (for local testing only) export REFRESH_TOKEN="your-token" export CLIENT_ID="your-client-id" export CLIENT_SECRET="your-client-secret" # Start the MCP server python mcp_server.py ``` ```bash curl -X POST http://localhost:8000/mcp \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"tools/list","params":{},"id":1}' ``` -------------------------------- ### Install AgentCore CLI and Verify Installation Source: https://advertising.amazon.com/API/docs/en-us/knowledge-hub/hands-on-workshops/workshop-gen-ai-langgraph-agents/00-environment-setup Install the bedrock-agentcore-starter-toolkit using pip and verify the installation by checking the agentcore CLI help output. ```bash pip install bedrock-agentcore-starter-toolkit agentcore --help ``` -------------------------------- ### Create Execution Request (Default) Source: https://advertising.amazon.com/API/docs/en-us/dsp-quick-actions Example of creating a new execution for an action. By default, `preview` is `false`, and the execution starts immediately. ```http POST /dsp/v1/quickactions/{actionId}/executions HTTP/1.1 Host: dsp.amazon.com Content-Type: application/json Amazon-Advertising-API-ClientId: YOUR_CLIENT_ID Amazon-Advertising-API-AdvertiserId: YOUR_ADVERTISER_ID Amazon-Advertising-API-MarketplaceId: YOUR_MARKETPLACE_ID Amazon-Ads-AccountId: YOUR_ACCOUNT_ID ``` -------------------------------- ### Create Tactics via DSP Quick Actions API Source: https://advertising.amazon.com/API/docs/en-us/guides/dsp/tactics Use the `actionIds` obtained from the Guidance API to create tactic ad groups via the DSP Quick Actions APIs. This example shows how to start the execution of multiple quick actions. ```json [ "action_id_XXXXX", "action_id_YYYYY" ] ``` -------------------------------- ### Set Up Project Directory and Install Dependencies Source: https://advertising.amazon.com/API/docs/en-us/knowledge-hub/hands-on-workshops/amazon-ads-mcp-server/03-build-mcp-server Navigate to the workshop directory, create a new directory for the MCP knowledge base server, and install required dependencies using pip. ```bash cd workshop-mcp mkdir mcp-knowledgebase cd mcp-knowledgebase ``` ```text mcp boto3 python-dotenv ``` ```bash pip install -r requirements.txt ``` -------------------------------- ### Create Report Request Source: https://advertising.amazon.com/API/docs/en-us/sponsored-display/3-0/openapi/prod Creates a report request for Sponsored Display. This endpoint is deprecated and users should refer to the 'Getting started with sponsored ads reports' guide for the call flow. ```APIDOC ## POST /sd/{recordType}/report ### Description Creates a report request for Sponsored Display campaigns, ad groups, product ads, targets, and ASINs. The 'asins' report is only available for seller brand owners. This endpoint is deprecated. ### Method POST ### Endpoint `/sd/{recordType}/report` ### Parameters #### Path Parameters - **recordType** (string) - Required - Enum: "campaigns" "adGroups" "productAds" "targets" "asins" - The type of report to generate. #### Header Parameters - **Amazon-Advertising-API-ClientId** (string) - Required - The identifier of a client associated with a "Login with Amazon" account. - **Amazon-Advertising-API-Scope** (string) - Required - The identifier of a profile associated with the advertiser account. #### Request Body - **reportDate** (string) - Optional - Date in YYYYMMDD format. The report contains only metrics generated on the specified date. The time zone used for date calculation is the one associated with the profile used to make the request. - **tactic** (string) - Optional - Enum: "T00020" "T00030" - The advertising tactic associated with the campaign. - **segment** (string) - Optional - Value: "matchedTarget" - A dimension used to further segment certain types of reports. Note: matchedTarget reports only return targets that have generated at least one click. - **metrics** (string) - Optional - A comma-separated list of the metrics to be included in the report. Each report type supports different metrics. ### Request Example ```json { "reportDate": "20231026", "tactic": "T00020", "segment": "matchedTarget", "metrics": "attributedSales14d,attributedUnitsOrdered14d" } ``` ### Response #### Success Response (307) Successful operation. #### Error Responses - **400** Bad Request - **401** Unauthorized - Request failed because user is not authenticated or is not allowed to invoke the operation. - **403** Forbidden - Request failed because user does not have access to a specified resource - **404** Not Found - Requested resource does not exist or is not visible for the authenticated user. - **429** Too Many Requests - Request was rate-limited. Retry later. - **500** Internal Server Error - Something went wrong on the server. Retry later and report an error if unresolved. #### Response Example (400) ```json { "code": "string", "details": "string" } ``` ``` -------------------------------- ### Install Dependencies and Link Library Source: https://advertising.amazon.com/API/docs/en-us/guides/get-started/generate-sdk Install project dependencies and create a local link for the client library. ```bash npm install npm link ``` -------------------------------- ### Response Sample for Get Brands Source: https://advertising.amazon.com/API/docs/en-us/sponsored-brands/3-0/category-benchmark Example JSON response structure for the 'Get a list of brands' endpoint, including brand names and a pagination token. ```json { "brands": [ { "name": "string" } ], "nextPageToken": "string" } ``` -------------------------------- ### Get Payment Agreements API Request Example Source: https://advertising.amazon.com/API/docs/en-us/billing-statements This example demonstrates how to structure a request to the GetPaymentAgreements API endpoint to retrieve payment agreements for a customer. ```http GET https://d1y2lf8k3vrkfu.cloudfront.net/billing/paymentAgreements/list?agreementType=AUTO_PAY Header: Amazon-Ads-AccountId: 1234567890abcdef Amazon-Advertising-API-ClientId: abcdef1234567890 Amazon-Advertising-API-Scope: profileId12345 Amazon-Advertising-API-Manager-Account: managerId98765 ``` -------------------------------- ### Complete Example: onboard_audience() Source: https://advertising.amazon.com/API/docs/en-us/knowledge-hub/hands-on-workshops/1st-party-data-workshop/01-onboard-audience-data This Python script demonstrates the complete process of onboarding audience data using the Amazon DSP API. It includes creating a DSP audience, setting up sharing rules, and verifying the creation. Ensure environment variables like DSP_ACCOUNT_ENTITY_ID are set. ```python dsp_account_entity_id = os.getenv('DSP_ACCOUNT_ENTITY_ID') print(f"Using DSP_DESTINATION_ACCOUNT_ID: {dsp_destination_account_id}") print(f"Using MARKETPLACE_ID: {marketplace_id}") print(f"Using DSP_ACCOUNT_ENTITY_ID: {dsp_account_entity_id}") try: sharing_rule = client.create_dsp_audience( dataset_id=dataset_id, destination_account_id=dsp_destination_account_id, marketplace_id=marketplace_id, audience_name='Test Audience Q1 2026', description='High-value customers for DSP targeting', account_entity_id=dsp_account_entity_id ) # Verify print(f"=== Step 6: Verifying Sharing Rules ===") client.list_sharing_rules( dataset_id=dataset_id, application='DSP_AUDIENCES', statuses=['ACTIVE', 'PENDING'] ) except Exception as e: print(f"⚠ Sharing rule creation failed: {str(e)}") print("Troubleshooting tips:") print("1. Verify the DSP advertiser ID is correct and linked to your manager account") print("2. Confirm the DSP account has ADM audience sharing enabled") print("3. Check if the marketplace ID matches the DSP account's region") print("4. Review the error response above for specific API error messages") print(f"Onboarding complete. Dataset ID: {dataset_id}") return dataset_id if __name__ == '__main__': onboard_audience() ``` -------------------------------- ### Install Project Dependencies Source: https://advertising.amazon.com/API/docs/en-us/knowledge-hub/hands-on-workshops/amazon-ads-mcp-server/08-build-ads-agent Create a requirements.txt file with all necessary dependencies and then install them using pip. ```bash fastapi uvicorn langchain langchain-core langchain-aws langgraph langchain-mcp-adapters pydantic boto3 python-dotenv requests bedrock-agentcore ``` ```bash pip install -r requirements.txt ``` -------------------------------- ### Get Campaign Details Response Source: https://advertising.amazon.com/API/docs/en-us/guides/sponsored-display/tutorials/how-to-build-ct-campaigns Example response when retrieving details for a specific campaign. ```json { "campaignId": 222756009537583, "name": "My Contextual Targeting Campaign 2", "tactic": "T00020", "startDate": "20200812", "endDate": "20301201", "state": "paused", "budget": 100.00, "budgetType": "daily", "costType": "cpc", "deliveryProfile": "as_soon_as_possible" } ``` -------------------------------- ### Create Agent Project Directory and Install Dependencies Source: https://advertising.amazon.com/API/docs/en-us/knowledge-hub/hands-on-workshops/amazon-ads-mcp-server/05-build-langgraph-agent Sets up the project directory and installs necessary Python dependencies for the agent. ```bash cd .. mkdir kb-agent cd kb-agent ``` ```bash fastapi uvicorn langchain langchain-core langchain-aws langgraph pydantic boto3 python-dotenv ``` ```bash pip install -r requirements.txt ``` -------------------------------- ### Initialize Client Package and Link Library Source: https://advertising.amazon.com/API/docs/en-us/guides/get-started/generate-sdk Initialize the client directory as an NPM package 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 ``` -------------------------------- ### GET Sponsored Display Campaigns Source: https://advertising.amazon.com/API/docs/en-us/getting-started/first-call This example shows a GET Sponsored Display campaigns request using the North America URL prefix. It includes necessary headers for authentication and authorization. ```APIDOC ## GET sd/campaigns ### Description Retrieves a list of Sponsored Display campaigns associated with the authenticated account. ### Method GET ### Endpoint /sd/campaigns ### Parameters #### Path Parameters None #### Query Parameters None #### Headers - **Amazon-Ads-ClientId** (string) - Required - Your application's Client ID. - **Amazon-Advertising-API-Scope** (string) - Required - The identifier for the advertising account. - **Authorization** (string) - Required - Bearer token for authentication. ### Request Example ```json { "request": "GET https://advertising-api.amazon.com/sd/campaigns" } ``` ### Response #### Success Response (200) Returns a JSON array of campaign objects. Each object contains details about a Sponsored Display campaign. - **campaignId** (long) - The unique identifier for the campaign. - **name** (string) - The name of the campaign. - **tactic** (string) - The campaign tactic. - **startDate** (string) - The start date of the campaign in YYYYMMDD format. - **state** (string) - The current state of the campaign (e.g., enabled, paused). - **costType** (string) - The cost type of the campaign (e.g., cpc). - **budget** (number) - The campaign budget amount. - **budgetType** (string) - The type of budget (e.g., daily, monthly). - **deliveryProfile** (string) - The delivery profile for the campaign. #### Response Example ```json [ { "campaignId": 127519806194475, "name": "SdTestCampaign-26/01/2022 15:37:31", "tactic": "T00020", "startDate": "20220126", "state": "enabled", "costType": "cpc", "budget": 100, "budgetType": "daily", "deliveryProfile": "as_soon_as_possible" } ] ``` #### Empty Response Example (200) ```json [] ``` ``` -------------------------------- ### Start and End Date Example Source: https://advertising.amazon.com/API/docs/en-us/guides/media-planning/reach-forecasting/get-started Defines the date range for the forecast. Dates must be in YYYY-MM-DD format, in the future, and the end date must be after the start date within an 18-month window. ```json "startDate": "2026-01-01", "endDate": "2026-01-15" ``` -------------------------------- ### Install Dependencies Source: https://advertising.amazon.com/API/docs/en-us/guides/get-started/generate-sdk Run this command before the first build to install all the necessary project dependencies. ```bash npm install ``` -------------------------------- ### Get Payment Agreements API Request Example Source: https://advertising.amazon.com/API/docs/en-us/billing This example demonstrates how to make a POST request to the /billing/paymentAgreements/list endpoint to retrieve payment agreements for a customer. Ensure you include the required 'Amazon-Ads-AccountId' or 'Amazon-Advertising-API-Manager-Account' header along with 'Amazon-Advertising-API-ClientId' and 'Amazon-Advertising-API-Scope'. ```bash POST /billing/paymentAgreements/list HTTP/1.1 Host: d1y2lf8k3vrkfu.cloudfront.net Amazon-Ads-AccountId: YOUR_AMAZON_ADS_ACCOUNT_ID Amazon-Advertising-API-ClientId: YOUR_CLIENT_ID Amazon-Advertising-API-Scope: YOUR_PROFILE_ID Content-Type: application/json { "agreementType": "AUTO_PAY" } ``` -------------------------------- ### Get Banded Size Request Source: https://advertising.amazon.com/API/docs/en-us/guides/dsp/persona-builder Example cURL request to the /insights/bandedSize API endpoint to get an estimated size range for an audience expression. Ensure to replace placeholders with your actual advertiser ID, client ID, authorization token, and scope. ```bash curl --location 'https://advertising-api.amazon.com/insights/bandedSize?advertiserId=xxxxxxx' \ --header 'Amazon-Advertising-API-ClientId: amzn1.application-xxxxxxxxx' \ --header 'Authorization: Bearer Atza|xxxxxxx' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'Amazon-Advertising-API-Scope: xxxxxxxx' \ --data '{ "audienceTargetingExpression": { "audiences": [ { "negative": "false", "groupId": "Group 1", "audienceId": "4193226111111" }, { "negative": "false", "groupId": "Group 1", "audienceId": "37638381111111" } ] } }' ``` -------------------------------- ### List Manager Accounts Response Source: https://advertising.amazon.com/API/docs/en-us/guides/account-management/authorization/manager-accounts Example response structure for the GET /managerAccounts endpoint, showing manager accounts and their linked accounts. ```json { "managerAccounts": [ { "linkedAccounts": [ { "accountId": "ENTITYxxxxxxxxxxx", "accountName": "AdsCustomer, Inc.", "accountType": "SELLER", "dspAdvertiserId": "", "marketplaceId": "ATVPDKIKX0DER", "profileId": "xxxxxxxxxxxxxxxx" } ], "managerAccountId": "amzn1.ads1.ma1.xxxxxxxxxxxxxxxxxxxxxx", "managerAccountName": "my_manager_account" } ] } ``` -------------------------------- ### Install Dependencies for Deployment Tool Source: https://advertising.amazon.com/API/docs/en-us/knowledge-hub/hands-on-workshops/workshop-gen-ai-langgraph-agents/06b-deployment-automated Navigate to the deployment tool directory and install the required Python packages using pip. ```bash cd deployment_tool pip install -r requirements.txt ``` -------------------------------- ### Test the Client Application Source: https://advertising.amazon.com/API/docs/en-us/guides/get-started/generate-sdk Run this command to test the client application after building it. ```bash npm run start ``` -------------------------------- ### Example Negative Targeting Clause (GET) Source: https://advertising.amazon.com/API/docs/en-us/sponsored-display/3-0/openapi/prod This JSON structure represents a negative targeting clause, often used when retrieving existing clauses. ```json [ { "state": "enabled", "adGroupId": 0, "expressionType": "manual", "expression": [ { "type": "asinSameAs", "value": "B0123456789" } ], "resolvedExpression": [ { "type": "asinSameAs", "value": "B0123456789" } ] } ] ``` -------------------------------- ### Full Audience Lifecycle Management Example Source: https://advertising.amazon.com/API/docs/en-us/knowledge-hub/hands-on-workshops/1st-party-data-workshop/05-manage-audience-lifecycle Demonstrates a complete audience lifecycle management process, including adding new members, removing opted-out users, and checking updated metrics. This example requires an ADMClient instance and a valid dataset ID. ```python def manage_audience_lifecycle(): """Demonstrate adding, removing members, and cleaning up.""" client = ADMClient() client.authenticate() dataset_id = 'your_dataset_id' # Add new customers who joined this week new_customers = [ {'id': 'cust_100', 'email': 'new_user@example.com', 'first_name': 'Carol', 'last_name': 'White'}, ] add_members_to_dataset(client, dataset_id, new_customers) # Remove customers who opted out churned = [ {'id': 'cust_005', 'email': 'opted_out@example.com'}, ] remove_members_from_dataset(client, dataset_id, churned) # Check updated metrics (uses get_dataset_metrics() from Use Case 7) get_dataset_metrics(client, dataset_id) ``` -------------------------------- ### Get Budget Rules for a Campaign (Europe Endpoint) Source: https://advertising.amazon.com/API/docs/en-us/sponsored-display/3-0/openapi/prod Example of how to construct a request to retrieve budget rules associated with a specific campaign in Europe. ```bash https://advertising-api-eu.amazon.com/sd/campaigns/{campaignId}/budgetRules ``` -------------------------------- ### Start Execution Source: https://advertising.amazon.com/API/docs/en-us/dsp-quick-actions Starts a preview execution, transitioning its state from `PREVIEW` to `IN_PROGRESS`. You can monitor the execution's progress by retrieving it using `getExecution`. ```APIDOC ## PUT /dsp/v1/quickactions/{actionId}/executions/{executionId}/start ### Description Starts an execution. ### Method PUT ### Endpoint /dsp/v1/quickactions/{actionId}/executions/{executionId}/start ### Parameters #### Path Parameters - **actionId** (string) - Required - ID of action to execute. Max 64 characters. - **executionId** (string) - Required - ID of execution to start. Can be obtained by calling `createExecution` with `preview` set to `true`. Max 64 characters. #### Query Parameters - **omitStepIds** (Array of integers) - Optional - List of optional steps that should be omitted. If not specified, all steps will be executed. #### Header Parameters - **Amazon-Advertising-API-ClientId** (string) - Required - The identifier of the application making an API request on behalf of the customer. - **Amazon-Advertising-API-AdvertiserId** (string) - Required - The DSP entity identifier that the user requested access to. - **Amazon-Advertising-API-MarketplaceId** (string) - Required - The marketplace identifier that the user requested access to. - **Amazon-Ads-AccountId** (string) - Optional - Account identifier you use to access the DSP. This is your Amazon DSP Advertiser ID. ### Responses #### Success Response (200) The execution was successfully started #### Error Response (400) Invalid request #### Error Response (404) Execution not found #### Error Response (409) The execution was already in a non-preview state; the current execution details are returned ### Response Example (200) ```json { "actionId": "string", "actionType": "string", "id": "string", "state": "COMPLETED", "steps": [ { "displayText": "string", "errorMessage": "string", "id": 0, "optional": true, "state": "ABANDONED", "type": "string" } ] } ``` ``` -------------------------------- ### Get Targeting Clause Response Source: https://advertising.amazon.com/API/docs/en-us/guides/sponsored-display/tutorials/how-to-build-audt-campaigns This is an example of the response when retrieving a targeting clause. It includes details about the ad group, bid, expression, and state. ```json { "adGroupId": 209426065354910, "bid": 0.25, "expression": [ { "type": "views", "value": [ { "type": "similarProduct" }, { "type": "lookback", "value": "30" } ] } ], "expressionType": "manual", "resolvedExpression": [ { "type": "views", "value": [ { "type": "similarProduct" }, { "type": "lookback", "value": "30" } ] } ], "state": "enabled", "targetId": 235944225366139 } ``` -------------------------------- ### MCP Server Test Mode Output Example Source: https://advertising.amazon.com/API/docs/en-us/knowledge-hub/hands-on-workshops/amazon-ads-mcp-server/03-build-mcp-server Observe this output to confirm the server is running correctly in test mode and successfully querying the knowledge base. It includes environment variable loading, server status, and a sample query response. ```text [INFO] 2025-01-15T10:30:00.000000 - Environment variables loaded [INFO] 2025-01-15T10:30:00.000000 - Knowledge Base MCP port: 8000 [INFO] 2025-01-15T10:30:00.000000 - Knowledge Base server started - AgentCore compliant [INFO] 2025-01-15T10:30:00.000000 - Starting MCP server in test mode [INFO] 2025-01-15T10:30:00.000000 - Querying knowledge base with: What is Amazon DSP? === Testing query_knowledge_base === { "query": "What is Amazon DSP?", "results_count": 5, "results": [ { "content": "Amazon DSP is a demand-side platform...", "score": 0.85, "location": { ... }, "metadata": { ... } } ] } ``` -------------------------------- ### Deploy Infrastructure with CDK Source: https://advertising.amazon.com/API/docs/en-us/knowledge-hub/hands-on-workshops/workshop-gen-ai-langgraph-agents/07-rds-mcp-gateway Navigate to the project directory, install dependencies, build the project, and deploy all CDK infrastructure. This command requires no user approval for deployment. ```bash cd custom-ads-rds-mcp-agent npm install npm run build cdk deploy --all --require-approval never ``` -------------------------------- ### Product Recommendations Request Payload Source: https://advertising.amazon.com/API/docs/en-us/sponsored-products/3-0/openapi/prod Example of a request payload for Sponsored Products API to get product recommendations. Includes ASINs, count, cursor, and locale. ```json { "adAsins": [ "BX20002121" ], "count": "5", "cursor": "MTAxNTwNzI5NDE=", "locale": "en_US" } ``` -------------------------------- ### Keyword Targeting Example Source: https://advertising.amazon.com/API/docs/en-us/guides/media-planning/reach-forecasting/get-started Demonstrates how to set up keyword targeting for ad campaigns. This includes specifying the keyword, match type, and bid information. It also shows an example of product targeting which can be used in conjunction with keyword targeting. ```json { "negative": false, "bid": { "bid": 0.75, "currencyCode": "USD" }, "targetDetails": { "keywordTarget": { "targetType": "KEYWORD", "keyword": "AirPods Pro 2", "matchType": "PHRASE" } } }, { "negative": false, "targetDetails": { "productTarget": { "targetType": "PRODUCT", "asin": "B0D1XD1ZV3" } } } ``` -------------------------------- ### Get Budget Rules for a Campaign (Far East Endpoint) Source: https://advertising.amazon.com/API/docs/en-us/sponsored-display/3-0/openapi/prod Example of how to construct a request to retrieve budget rules associated with a specific campaign in the Far East. ```bash https://advertising-api-fe.amazon.com/sd/campaigns/{campaignId}/budgetRules ``` -------------------------------- ### Setup Root Files for SDK Source: https://advertising.amazon.com/API/docs/en-us/guides/get-started/generate-sdk Configures the root directory of the generated SDK by copying runtime files and creating a root index file. This function ensures that the SDK structure is correctly set up for import and usage. ```javascript function setupRootFiles(adProducts) { // 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'); } ``` -------------------------------- ### Get Budget Rules for a Campaign (North America Endpoint) Source: https://advertising.amazon.com/API/docs/en-us/sponsored-display/3-0/openapi/prod Example of how to construct a request to retrieve budget rules associated with a specific campaign in North America. ```bash https://advertising-api.amazon.com/sd/campaigns/{campaignId}/budgetRules ``` -------------------------------- ### Retrieve an Entertainment Target Source: https://advertising.amazon.com/API/docs/en-us/guides/sponsored-display/entertainment-targeting Use the GET /sd/targets/{targetId} endpoint to retrieve details of a specific entertainment target. This example retrieves target with ID 11111222222. ```bash curl --location 'https://advertising-api.amazon.com/sd/targets/11111222222' \ --header 'Amazon-Advertising-API-ClientId: amzn1.application-oa2-client.xxxxxxxxxxxxx' \ --header 'Authorization: Bearer Atza|xxxxxxxx' \ --header 'Amazon-Advertising-API-Scope: xxxxxxxx' ``` -------------------------------- ### Install Core Dependencies Source: https://advertising.amazon.com/API/docs/en-us/knowledge-hub/hands-on-workshops/amazon-ads-mcp-server/01-overview Installs the necessary Python packages for the workshop. Ensure your virtual environment is activated before running. ```bash pip install mcp boto3 python-dotenv langchain langchain-core langchain-aws langgraph pydantic fastapi uvicorn bedrock-agentcore bedrock-agentcore-starter-toolkit uv ```