開発者ガイドの概要

Amazon Ads APIの概要

キャンペーン

警告

これらのエンドポイントは、6/30/2023に廃止されます。今後は、スポンサープロダクト広告バージョン3キャンペーンをご利用ください。詳細は、廃止予定のページをご覧ください。

キャンペーンの作成、読み取り、更新、削除に使用されます。次の表では、サービス管理リソースによってサポートされる URLスペースとHTTPメソッドという観点で、サービスの動作について説明しています。

メソッド URL ユースケース
GET /campaigns/{campaignId} IDを指定してキャンペーンを取得します
GET /campaigns/extended/{campaignId} IDを指定して、キャンペーンおよびその他のプロパティを取得します。
POST /campaigns 1つ以上のキャンペーンを作成します。
PUT /campaigns 1つ以上のキャンペーンを更新します。
DELETE /campaigns/{campaignId} 1つの特定のキャンペーンを非表示にします。非表示にされたエンティティを再度アクティブにすることはできません。詳細は、開発者メモをご覧ください。
GET /campaigns?startIndex={startIndex}&count={count}&campaignType={campaignType}&stateFilter={stateFilter}&name={name}&campaignIdFilter={campaignIdFilter} 指定した条件に基づいてキャンペーンのリストを返します。
GET /campaigns/extended?startIndex={startIndex}&count={count}&campaignType={campaignType}&stateFilter={stateFilter}&name={name}&campaignIdFilter={campaignIdFilter} 指定した条件に基づいて、キャンペーンとその他のプロパティのリストを返します。

オペレーション

getCampaign

GET /campaigns/{campaignId}

IDを指定して、キャンペーンを取得します。この呼び出しは、最小限の数のキャンペーンフィールドを 返しますが、getCampaignExより効率的です。

パラメーター

パラメーター名 タイプ 説明
campaignId 文字列 リクエストするキャンペーンのID

応答

ステータスコード 応答オブジェクト
200 - success Campaign
401 - unauthorized Error
404 - campaign not found Error

getCampaignEx

GET /campaigns/extended/{campaignId}

IDを指定して、キャンペーンとその拡張フィールドを取得します。この呼び出しは、 キャンペーンフィールドをすべて(配信ステータス およびその他の読み取り専用フィールドを含む)返しますが、getCampaignより非効率的です。

パラメーター

パラメーター名 タイプ 指定する場所 説明
campaignId 文字列 URLパス リクエストするキャンペーンのID

応答

ステータスコード 応答オブジェクト
200 - success CampaignEx
401 - unauthorized Error
404 - campaign not found Error

createCampaigns

POST /campaigns

1つ以上のキャンペーンを作成します。正常に作成されたキャンペーンには 一意のcampaignIdが割り当てられます。

パラメーター

タイプ 指定する場所 説明
Campaignのリスト 本文 作成する最大100個のキャンペーンのリスト。キャンペーン作成の必須フィールド:namecampaignTypetargetingTypestatedailyBudgetstartDate

応答

ステータスコード 応答オブジェクト
207 - multi-status 入力されたのと同じ順序のCampaignResponseのリスト
401 - unauthorized Error

updateCampaigns

PUT /campaigns

1つ以上のキャンペーンを更新します。キャンペーンは、campaignIdで指定します。

パラメーター

タイプ 指定する場所 説明
Campaignのリスト 本文 campaignIdおよび変更する変更可能フィールドを含む、最大100件の更新のリスト。次の変更可能フィールドのリスト:namestatedailyBudgetstartDateendDatepremiumBidAdjustment

応答

ステータスコード 応答オブジェクト
207 – multi-status 入力されたのと同じ順序のCampaignResponseのリスト
401 - unauthorized Error

archiveCampaign

DELETE /campaigns/{campaignId}

キャンペーンステータスを非表示に設定します。更新でもこれと同じ操作を 実行できますが、完全を期すために含められています。非表示にした エンティティを再度アクティブにすることはできません。詳細は、開発者メモをご覧ください 。

パラメーター

パラメーター名 タイプ 指定する場所 説明
campaignId 文字列 URLパス 非表示にするキャンペーンのID。

応答

ステータスコード 応答オブジェクト
200 - success CampaignResponse
401 - unauthorized Error
404 - campaign not found Error

listCampaigns

  GET /campaigns
    ?startIndex={startIndex}
    &count={count}
    &campaignType={campaignType}
    &stateFilter={stateFilter}
    &name={name}
    &campaignIdFilter={campaignIdFilter}  

オプションの条件を満たすキャンペーンのリストを取得します。

パラメーター

パラメーター名 タイプ 指定する場所 説明
startIndex integer URLクエリ オプション。結果セットを指す0始まりのレコードオフセット。デフォルトは0です。
count integer URLクエリ オプション。ページングされるレスポンスに含めるレコードの数。デフォルトでは、最大ページサイズに設定されます。
campaignType 文字列 URLクエリ オプション。単一のキャンペーンタイプのキャンペーンだけに結果を制限します。
指定できるのは、sponsoredProductsです。
stateFilter 文字列 URLクエリ オプション。カンマ区切りリストで指定した状態のキャンペーンだけに結果を制限します。指定できる値は、enabledpausedarchivedのみです。デフォルトの動作では、すべてが含まれます。
name 文字列 URLクエリ オプション。指定した名前のキャンペーンだけに結果を制限します。
campaignIdFilter 文字列 URLクエリ オプション。カンマ区切りリストで指定したキャンペーンだけに結果を制限します。

応答

ステータスコード 応答オブジェクト
200 - success Campaignのリスト
401 - unauthorized Error

listCampaignsEx

  GET /campaigns/extended
    ?startIndex={startIndex}
    &count={count}
    &campaignType={campaignType}
    &stateFilter={stateFilter}
    &name={name}
    &campaignIdFilter={campaignIdFilter}

オプションのフィルター条件を満たす拡張フィールドを持つキャンペーンのリストを取得します。

パラメーター

パラメーター名 タイプ 指定する場所 説明
startIndex integer URLクエリ オプション。結果セットを指す0始まりのレコードオフセット。デフォルトは0です。
count integer URLクエリ オプション。ページングされるレスポンスに含めるレコードの数。デフォルトでは、最大ページサイズに設定されます。
campaignType 文字列 URLクエリ オプション。単一のキャンペーンタイプのキャンペーンだけに結果を制限します。指定できるのはsponsoredProductsです。
stateFilter 文字列 URLクエリ オプション。カンマ区切りリストで指定した状態のキャンペーンだけに結果を制限します。指定できる値は、enabled、paused、archivedのいずれかです。デフォルトの動作では、すべてが含まれます。
name 文字列 URLクエリ オプション。指定した名前のキャンペーンだけに結果を制限します。
campaignIdFilter 文字列 URLクエリ オプション。カンマ区切りリストで指定したキャンペーンだけに結果を制限します。

応答

ステータスコード 応答オブジェクト
200 - success CampaignExのリスト
401 - unauthorized Error

リソースの表現

Campaign

{
    "title": "Campaign",
    "type": "object",
    "properties": {
       "campaignId": {
           "description": "The ID of the campaign",
           "type": "number"
       },
       "name": {
           "description": "The name of the campaign",
           "type": "string"
       },
       "campaignType": {
           "description": "Specifies the advertising product managed by this campaign",
           "type": "string",
           "oneOf": ["sponsoredProducts"]
       },
       "targetingType": {
           "description": "Differentiates between a keyword-targeted and automatically targeted campaign",
           "type": "string",
           "oneOf": ["manual", "auto"]
       },
       "state": {
           "description": "Advertiser-specified state of the campaign",
           "type": "string",
           "oneOf": ["enabled", "paused", "archived"]
       },
       "dailyBudget": {
           "description": "Daily budget for the campaign",
           "type": "number",
           "minimum": 1.00
       },
       "startDate": {
           "description": "The date the campaign will go or went live as YYYYMMDD",
           "type": "string"
       },
       "endDate": {
           "description": "The optional date the campaign will stop running as YYYYMMDD",
           "type": "string"
       },
       "premiumBidAdjustment": {
           "description": "When enabled, Amazon will increase the default bid for your ads that are eligible to appear in this placement.See developer notes for more information.",
           "type": "boolean"
       }
    }
}

CampaignEx

{
    "title": "CampaignEx",
    "type": "object",
    "properties": {
       "campaignId": {
           "description": "The ID of the campaign",
           "type": "number"
       },
       "name": {
           "description": "The name of the campaign",
           "type": "string"
       },
       "campaignType": {
           "description": "Specifies the advertising product managed by this campaign",
           "type": "string",
           "oneOf": ["sponsoredProducts"]
       },
       "targetingType": {
           "description": "Differentiates between a keyword-targeted and automatically targeted campaign",
           "type": "string",
           "oneOf": ["manual", "auto"]
       },
       "state": {
           "description": "Advertiser-specified state of the campaign",
           "type": "string",
           "oneOf": ["enabled", "paused", "archived"]
       },
       "dailyBudget": {
           "description": "Daily budget for the campaign in dollars",
           "type": "number",
           "minimum": 1.00
       },
       "startDate": {
           "description": "The date the campaign will go or went live as YYYYMMDD",
           "type": "string"
       },
       "endDate": {
           "description": "The optional date the campaign will stop running as YYYYMMDD",
           "type": "string"
       },
       "premiumBidAdjustment": {
    "description": "When enabled, Amazon will increase the default bid for your ads that are eligible to appear in this placement.See developer notes for more information.",
           "type": "boolean"
       },
       "placement": {
           "description": "Ad placement.Only returned when segment is set to placement.",
           "type": "string",
           "oneOf": ["Top of Search on-Amazon", "Other on-Amazon"]
       },
       "creationDate": {
           "description": "The date the campaign was created as epoch time in milliseconds",
           "type": "number"
       },
       "lastUpdatedDate": {
           "description": "The date the campaign was last updated as epoch time in milliseconds",
           "type": "number"
       },
       "servingStatus": {
           "description": "The computed status, accounting for campaign out of budget, policy violations, etc.See developer notes for more information.",
           "type": "string",
"oneOf": ["CAMPAIGN_ARCHIVED", "CAMPAIGN_PAUSED", "CAMPAIGN_STATUS_ENABLED","ADVERTISER_PAYMENT_FAILURE", "CAMPAIGN_OUT_OF_BUDGET", "ACCOUNT_OUT_OF_BUDGET"]
       }
    }
}

CampaignResponse

{
    "title": "CampaignResponse",
    "type": "object",
    "properties": {
       "campaignId": {
           "description": "The ID of the campaign that was created/updated, if successful",
           "type": "number"
       },
       "code": {
           "description": "An enumerated success or error code for machine use.",
           "type": "string"
       },
       "details": {
           "description": "A human-readable description of the error, if unsuccessful",
           "type": "string"
       }
    }
}

エラー

開発者メモで説明されているエラーオブジェクトの戻り値形式を参照してください。