共用方式為


ApplyProductPartitionActions 服務作業 - 活動管理

將新增、更新或刪除動作套用至每個指定的 BiddableAdGroupCriterionNegativeAdGroupCriterion,其中每個都包含 ProductPartition

提示

如需 Microsoft 購物活動的概觀和詳細資訊,請參閱 產品廣告智慧型購物活動 技術指南。

請注意下列驗證規則。

  • 您至少必須指定產品資料分割群組樹狀結構的根節點。 產品資料分割群組的根 BiddableAdGroupCriterion 必須將其條件 Operand 設定為 「All」 且 Attribute 設為 null。 如果您同樣地對目錄中的所有產品都抱抱心,請將 PartitionType 設定為 Unit。 如果您要根據更特定的產品條件來分割估價,請將 PartitionType 設定為 Subdivision、將 ParentCriterionId 設為 null,並將 Id 設為負值。 對於任何子節點,您都會使用負值做為 ParentCriterionId

  • 根節點會被視為層級 0,而樹狀結構最多可以有 7 層深的分支。

  • 每個呼叫最多可指定 5,000 個 AdGroupCriterionAction 物件。 透過多個呼叫建立的整個樹狀結構最多可以有 20,000 個節點。

  • 每個 AdGroupCriterionAction 物件都必須有相同的 AdGroupId,否則呼叫將會失敗。

  • 若要更新 ConditionAttribute 屬性,您必須刪除現有的產品資料分割樹狀節點,並新增會取得新識別碼的產品分割樹狀節點。 同樣地,若要從 BiddableAdGroupCriterion 更新為 NegativeAdGroupCriterion ,反之亦然,您必須刪除現有的產品分割樹節點,並新增新的產品分割樹狀節點,以取得新的識別碼。

  • 如果有任何動作失敗,可能已成功的所有剩餘動作也會失敗。

  • 一次呼叫中的所有動作都必須產生完整的樹狀結構。 如果您需要針對每個廣告群組套用超過 5,000 個動作,則必須進行多次呼叫。 從第一次呼叫取得父廣告群組準則識別碼,然後在後續呼叫中視需要新增更多子系。

  • 從根節點到分支結尾的每個路徑都必須以分葉節點終止, (ProductPartitionType=Unit) 。 除非節點是 NegativeAdGroupCriterion,否則每個單位都必須有一個報價。

  • 每個細分必須至少有一個分葉節點在子分割條件的其餘部分進行比對,也就是使用與其同層級單位相同的運算元 (的) ,並將其 Attribute 設定為 null

  • 您只能在其父節點之後指定子節點。

  • 如果您要在父系或子系都不存在的多個層級中加入分割區,請使用負 int 值作為參考來識別父系。 例如,將父系的 Id和子系的 ParentCriterionId 專案設定為相同的負值。 負數識別碼只在呼叫期間有效。 回應訊息中會傳回每個成功新增廣告群組準則的唯一系統識別碼。

  • 針對[細分分割] 節點,會忽略BiddableAdGroupCriterionCriterionBidDestinationUrl元素。 這些元素只與資料分割節點) 單元 (分葉相關。

  • 產品分割準則一律會忽略AdGroupCriterionStatus元素。 若要新增、更新或刪除產品分割區,請設定對應AdGroupCriterionActionAction元素。

  • 若要暫停任何產品分割區,您必須呼叫 UpdateAdGroups來暫停整個廣告群組。 您可以呼叫 UpdateCampaigns 來暫停整個行銷活動。

  • AdGroupCriterion的[編輯][Status] 元素對於產品分割區準則沒有顯著的意義。 產品類別目錄的編輯驗證已在 Microsoft 商家中心商店中完成。

  • 針對Delete動作,您只需要在AdGroupCriterion中指定IdAdGroupId

  • 如果您刪除父系產品分割區,也會刪除其所有子系和子系。

  • 您不能在分支中指定重複的產品條件。

要求專案

ApplyProductPartitionActionsRequest物件會定義服務作業要求的主體標頭元素。 元素的順序必須與 要求 SOAP中所示的順序相同。

注意事項

除非下面另有說明,否則所有要求專案都是必要的。

要求本文專案

元素 說明 資料類型
CriterionActions 最多 5,000 個 AdGroupCriterionAction 物件的清單,其中每個物件都包含 Action 元素和 BiddableAdGroupCriterionNegativeAdGroupCriterion

所有廣告群組準則動作都必須適用于相同的廣告群組。 如需包括驗證規則在內的詳細資訊,請參閱 使用行銷活動管理服務建立 Microsoft 購物活動
AdGroupCriterionAction 數

要求標頭元素

元素 說明 資料類型
AuthenticationToken OAuth 存取權杖,代表具有 Microsoft Advertising 帳戶許可權之使用者的認證。

如需詳細資訊,請 參閱使用 OAuth 進行驗證
string
CustomerAccountId 擁有或與要求中實體相關聯之廣告帳戶的識別碼。 當兩者都需要時,此標頭元素必須具有與 AccountId body 元素相同的值。 此元素是大部分服務作業的必要專案,最佳做法是一律加以設定。

如需詳細資訊, 請參閱取得您的帳戶和客戶識別碼
string
CustomerId (使用者存取或操作之使用者) 客戶的管理員帳戶識別碼。 使用者可以存取多個管理員帳戶。 此元素是大部分服務作業的必要專案,最佳做法是一律加以設定。

如需詳細資訊, 請參閱取得您的帳戶和客戶識別碼
string
DeveloperToken 用來存取 Bing 廣告 API 的開發人員權杖。

如需詳細資訊 ,請參閱取得開發人員權杖
string
密碼 此元素會保留供內部使用,並會從未來的 API 版本中移除。 您必須使用 AuthenticationToken 元素來設定使用者認證。 string
UserName 此元素會保留供內部使用,並會從未來的 API 版本中移除。 您必須使用 AuthenticationToken 元素來設定使用者認證。 string

Response 元素

ApplyProductPartitionActionsResponse物件會定義服務作業回應的主體標頭元素。 這些元素的傳回順序與 回應 SOAP中所示的順序相同。

回應本文專案

元素 說明 資料類型
AdGroupCriterionIds 識別已套用動作之準則的識別碼清單。 識別碼清單會直接對應至要求中的準則清單。

如果有任何準則動作失敗,則所有剩餘的準則動作都會失敗,而且此清單中的所有元素都會是 Null。
long 陣列
PartialErrors BatchError物件的陣列,其中包含任何未成功要求專案的詳細資料。

錯誤清單不會直接對應至要求中的專案清單。 如果沒有錯誤,清單可以是空的,或者可以包含一或多個對應到要求中每個不成功清單專案的錯誤物件。

針對因使用者錯誤而失敗的準則,將會傳回可採取動作的錯誤碼。

如果有任何準則動作失敗,則所有剩餘的準則動作都會失敗,而且此清單中的任何專案都不會是 Null。 如果準則可能已成功,則會傳回一般錯誤,說明相關實體失敗。
BatchError 數

回應標頭元素

元素 說明 資料類型
TrackingId 包含 API 呼叫詳細資料的記錄專案識別碼。 string

要求 SOAP

此範本是由工具所產生,用來顯示 SOAP 要求的主體標頭元素順序。 如需可搭配此服務作業使用的支援類型,請參閱上述 的要求本文專案 參考。

<s:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header xmlns="https://bingads.microsoft.com/CampaignManagement/v13">
    <Action mustUnderstand="1">ApplyProductPartitionActions</Action>
    <AuthenticationToken i:nil="false">ValueHere</AuthenticationToken>
    <CustomerAccountId i:nil="false">ValueHere</CustomerAccountId>
    <CustomerId i:nil="false">ValueHere</CustomerId>
    <DeveloperToken i:nil="false">ValueHere</DeveloperToken>
  </s:Header>
  <s:Body>
    <ApplyProductPartitionActionsRequest xmlns="https://bingads.microsoft.com/CampaignManagement/v13">
      <CriterionActions i:nil="false">
        <AdGroupCriterionAction>
          <Action>ValueHere</Action>
          <AdGroupCriterion i:nil="false" i:type="-- derived type specified here with the appropriate prefix --">
            <AdGroupId>ValueHere</AdGroupId>
            <Criterion i:nil="false" i:type="-- derived type specified here with the appropriate prefix --">
              <Type i:nil="false">ValueHere</Type>
              <!--These fields are applicable if the derived type attribute is set to ProductPartition-->
              <Condition i:nil="false">
                <Attribute i:nil="false">ValueHere</Attribute>
                <Operand i:nil="false">ValueHere</Operand>
                <Operator i:nil="false">ValueHere</Operator>
              </Condition>
              <ParentCriterionId i:nil="false">ValueHere</ParentCriterionId>
              <PartitionType>ValueHere</PartitionType>
              <!--These fields are applicable if the derived type attribute is set to HotelGroup-->
              <Listing i:nil="false">
                <Attribute i:nil="false">ValueHere</Attribute>
                <Operand i:nil="false">ValueHere</Operand>
              </Listing>
              <ListingType>ValueHere</ListingType>
              <ParentCriterionId i:nil="false">ValueHere</ParentCriterionId>
              <!--These fields are applicable if the derived type attribute is set to HotelAdvanceBookingWindowCriterion-->
              <MaxDays i:nil="false">ValueHere</MaxDays>
              <MinDays i:nil="false">ValueHere</MinDays>
              <!--These fields are applicable if the derived type attribute is set to HotelCheckInDateCriterion-->
              <EndDate i:nil="false">ValueHere</EndDate>
              <StartDate i:nil="false">ValueHere</StartDate>
              <!--This field is applicable if the derived type attribute is set to HotelCheckInDayCriterion-->
              <CheckInDay i:nil="false">ValueHere</CheckInDay>
              <!--This field is applicable if the derived type attribute is set to HotelDateSelectionTypeCriterion-->
              <HotelDateSelectionType i:nil="false">ValueHere</HotelDateSelectionType>
              <!--These fields are applicable if the derived type attribute is set to HotelLengthOfStayCriterion-->
              <MaxNights i:nil="false">ValueHere</MaxNights>
              <MinNights i:nil="false">ValueHere</MinNights>
              <!--This field is applicable if the derived type attribute is set to ProductScope-->
              <Conditions i:nil="false">
                <ProductCondition>
                  <Attribute i:nil="false">ValueHere</Attribute>
                  <Operand i:nil="false">ValueHere</Operand>
                  <Operator i:nil="false">ValueHere</Operator>
                </ProductCondition>
              </Conditions>
              <!--This field is applicable if the derived type attribute is set to Webpage-->
              <Parameter i:nil="false">
                <Conditions i:nil="false">
                  <WebpageCondition>
                    <Argument i:nil="false">ValueHere</Argument>
                    <Operand>ValueHere</Operand>
                    <Operator i:nil="false">ValueHere</Operator>
                  </WebpageCondition>
                </Conditions>
                <CriterionName i:nil="false">ValueHere</CriterionName>
              </Parameter>
              <!--This field is applicable if the derived type attribute is set to AgeCriterion-->
              <AgeRange i:nil="false">ValueHere</AgeRange>
              <!--These fields are applicable if the derived type attribute is set to DeviceCriterion-->
              <DeviceName i:nil="false">ValueHere</DeviceName>
              <OSName i:nil="false">ValueHere</OSName>
              <!--These fields are applicable if the derived type attribute is set to DayTimeCriterion-->
              <Day i:nil="false">ValueHere</Day>
              <FromHour i:nil="false">ValueHere</FromHour>
              <FromMinute i:nil="false">ValueHere</FromMinute>
              <ToHour i:nil="false">ValueHere</ToHour>
              <ToMinute i:nil="false">ValueHere</ToMinute>
              <!--This field is applicable if the derived type attribute is set to GenderCriterion-->
              <GenderType i:nil="false">ValueHere</GenderType>
              <!--These fields are applicable if the derived type attribute is set to RadiusCriterion-->
              <LatitudeDegrees i:nil="false">ValueHere</LatitudeDegrees>
              <LongitudeDegrees i:nil="false">ValueHere</LongitudeDegrees>
              <Name i:nil="false">ValueHere</Name>
              <Radius i:nil="false">ValueHere</Radius>
              <RadiusUnit i:nil="false">ValueHere</RadiusUnit>
              <!--These fields are applicable if the derived type attribute is set to LocationCriterion-->
              <DisplayName i:nil="false">ValueHere</DisplayName>
              <EnclosedLocationIds i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
                <a1:long>ValueHere</a1:long>
              </EnclosedLocationIds>
              <LocationId i:nil="false">ValueHere</LocationId>
              <LocationType i:nil="false">ValueHere</LocationType>
              <!--This field is applicable if the derived type attribute is set to LocationIntentCriterion-->
              <IntentOption i:nil="false">ValueHere</IntentOption>
              <!--These fields are applicable if the derived type attribute is set to AudienceCriterion-->
              <AudienceId i:nil="false">ValueHere</AudienceId>
              <AudienceType i:nil="false">ValueHere</AudienceType>
              <!--These fields are applicable if the derived type attribute is set to ProfileCriterion-->
              <ProfileId>ValueHere</ProfileId>
              <ProfileType>ValueHere</ProfileType>
              <!--This field is applicable if the derived type attribute is set to StoreCriterion-->
              <StoreId i:nil="false">ValueHere</StoreId>
              <!--This field is applicable if the derived type attribute is set to DealCriterion-->
              <DealId>ValueHere</DealId>
              <!--This field is applicable if the derived type attribute is set to GenreCriterion-->
              <GenreId>ValueHere</GenreId>
              <!--These fields are applicable if the derived type attribute is set to PlacementCriterion-->
              <PlacementId>ValueHere</PlacementId>
              <PlacementName i:nil="false">ValueHere</PlacementName>
            </Criterion>
            <Id i:nil="false">ValueHere</Id>
            <Status i:nil="false">ValueHere</Status>
            <Type i:nil="false">ValueHere</Type>
            <!--These fields are applicable if the derived type attribute is set to BiddableAdGroupCriterion-->
            <CriterionBid i:nil="false" i:type="-- derived type specified here with the appropriate prefix --">
              <Type i:nil="false">ValueHere</Type>
              <!--This field is applicable if the derived type attribute is set to RateBid-->
              <RateAmount i:nil="false">
                <Amount i:nil="false">ValueHere</Amount>
              </RateAmount>
              <!--This field is applicable if the derived type attribute is set to FixedBid-->
              <Amount>ValueHere</Amount>
              <!--This field is applicable if the derived type attribute is set to BidMultiplier-->
              <Multiplier>ValueHere</Multiplier>
            </CriterionBid>
            <DestinationUrl i:nil="false">ValueHere</DestinationUrl>
            <EditorialStatus i:nil="false">ValueHere</EditorialStatus>
            <FinalAppUrls i:nil="false">
              <AppUrl>
                <OsType i:nil="false">ValueHere</OsType>
                <Url i:nil="false">ValueHere</Url>
              </AppUrl>
            </FinalAppUrls>
            <FinalMobileUrls i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
              <a1:string>ValueHere</a1:string>
            </FinalMobileUrls>
            <FinalUrlSuffix i:nil="false">ValueHere</FinalUrlSuffix>
            <FinalUrls i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
              <a1:string>ValueHere</a1:string>
            </FinalUrls>
            <TrackingUrlTemplate i:nil="false">ValueHere</TrackingUrlTemplate>
            <UrlCustomParameters i:nil="false">
              <Parameters i:nil="false">
                <CustomParameter>
                  <Key i:nil="false">ValueHere</Key>
                  <Value i:nil="false">ValueHere</Value>
                </CustomParameter>
              </Parameters>
            </UrlCustomParameters>
            <CriterionCashback i:nil="false" i:type="-- derived type specified here with the appropriate prefix --">
              <Type i:nil="false">ValueHere</Type>
              <!--This field is applicable if the derived type attribute is set to CashbackAdjustment-->
              <CashbackPercent i:nil="false">ValueHere</CashbackPercent>
            </CriterionCashback>
            <!--No additional fields are applicable if the derived type attribute is set to NegativeAdGroupCriterion-->
          </AdGroupCriterion>
        </AdGroupCriterionAction>
      </CriterionActions>
    </ApplyProductPartitionActionsRequest>
  </s:Body>
</s:Envelope>

回應 SOAP

此範本是由工具所產生,用來顯示 SOAP 回應的 主體標頭 元素順序。

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header xmlns="https://bingads.microsoft.com/CampaignManagement/v13">
    <TrackingId d3p1:nil="false" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance">ValueHere</TrackingId>
  </s:Header>
  <s:Body>
    <ApplyProductPartitionActionsResponse xmlns="https://bingads.microsoft.com/CampaignManagement/v13">
      <AdGroupCriterionIds d4p1:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">
        <a1:long>ValueHere</a1:long>
      </AdGroupCriterionIds>
      <PartialErrors d4p1:nil="false" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">
        <BatchError d4p1:type="-- derived type specified here with the appropriate prefix --">
          <Code>ValueHere</Code>
          <Details d4p1:nil="false">ValueHere</Details>
          <ErrorCode d4p1:nil="false">ValueHere</ErrorCode>
          <FieldPath d4p1:nil="false">ValueHere</FieldPath>
          <ForwardCompatibilityMap xmlns:e70="http://schemas.datacontract.org/2004/07/System.Collections.Generic" d4p1:nil="false">
            <e70:KeyValuePairOfstringstring>
              <e70:key d4p1:nil="false">ValueHere</e70:key>
              <e70:value d4p1:nil="false">ValueHere</e70:value>
            </e70:KeyValuePairOfstringstring>
          </ForwardCompatibilityMap>
          <Index>ValueHere</Index>
          <Message d4p1:nil="false">ValueHere</Message>
          <Type d4p1:nil="false">ValueHere</Type>
          <!--These fields are applicable if the derived type attribute is set to EditorialError-->
          <Appealable d4p1:nil="false">ValueHere</Appealable>
          <DisapprovedText d4p1:nil="false">ValueHere</DisapprovedText>
          <Location d4p1:nil="false">ValueHere</Location>
          <PublisherCountry d4p1:nil="false">ValueHere</PublisherCountry>
          <ReasonCode>ValueHere</ReasonCode>
        </BatchError>
      </PartialErrors>
    </ApplyProductPartitionActionsResponse>
  </s:Body>
</s:Envelope>

程式碼語法

範例語法可以與 Bing 廣告 SDK搭配使用。 如需更多範例,請參閱 Bing 廣告 API 程式碼范 例。

public async Task<ApplyProductPartitionActionsResponse> ApplyProductPartitionActionsAsync(
	IList<AdGroupCriterionAction> criterionActions)
{
	var request = new ApplyProductPartitionActionsRequest
	{
		CriterionActions = criterionActions
	};

	return (await CampaignManagementService.CallAsync((s, r) => s.ApplyProductPartitionActionsAsync(r), request));
}
static ApplyProductPartitionActionsResponse applyProductPartitionActions(
	ArrayOfAdGroupCriterionAction criterionActions) throws RemoteException, Exception
{
	ApplyProductPartitionActionsRequest request = new ApplyProductPartitionActionsRequest();

	request.setCriterionActions(criterionActions);

	return CampaignManagementService.getService().applyProductPartitionActions(request);
}
static function ApplyProductPartitionActions(
	$criterionActions)
{

	$GLOBALS['Proxy'] = $GLOBALS['CampaignManagementProxy'];

	$request = new ApplyProductPartitionActionsRequest();

	$request->CriterionActions = $criterionActions;

	return $GLOBALS['CampaignManagementProxy']->GetService()->ApplyProductPartitionActions($request);
}
response=campaignmanagement_service.ApplyProductPartitionActions(
	CriterionActions=CriterionActions)

需求

服務: CampaignManagementService.svc v13
命名 空間: https://bingads.microsoft.com/CampaignManagement/v13