Compartilhar via


Operação de Serviço UpdateCampaignCriterions - Gestão de Campanhas

Atualizações um ou mais critérios de campanha.

Elementos do Pedido

O objeto UpdateCampaignCriterionsRequest define os elementos do corpo e do cabeçalho do pedido de operação do serviço. Os elementos têm de estar na mesma ordem mostrada no Pedido SOAP.

Nota

Salvo indicação em contrário abaixo, todos os elementos do pedido são necessários.

Elementos do Corpo do Pedido

Elemento Descrição Tipo de Dados
CampaignCriterions A lista de critérios de campanha a atualizar.

Pode incluir até 100 critérios de campanha por pedido.

Em cada objeto CampaignCriterion , tem de especificar o ID do critério e o ID da campanha à qual pertence.
Matriz CampaignCriterion
CriterionType O tipo de critério a atualizar, por exemplo página Web. Só pode especificar um valor de tipo de critério por chamada.

Para adicionar, eliminar ou atualizar critérios de destino, ou seja, idade, dia e hora, dispositivo, sexo, localização, intenção de localização e critérios radius, tem de especificar o valor CriterionType como Destinos. Pode adicionar, eliminar e atualizar vários tipos de critério de destino na mesma operação. Para obter estes critérios de destino através de GetCampaignCriterionsByIds , tem de pedir o tipo específico individualmente, ou seja, Age, DayTime, Device, Gender, Location, LocationIntent e Radius.
CampaignCriterionType

Elementos do Cabeçalho do Pedido

Elemento Descrição Tipo de Dados
AuthenticationToken O token de acesso OAuth que representa as credenciais de um utilizador que tem permissões para contas do Microsoft Advertising.

Para obter mais informações, veja Authentication with OAuth (Autenticação com OAuth).
cadeia
CustomerAccountId O identificador da conta de anúncio que detém ou está associada às entidades no pedido. Este elemento de cabeçalho tem de ter o mesmo valor que o elemento do corpo AccountId quando ambos são necessários. Este elemento é necessário para a maioria das operações de serviço e, como melhor prática, deve sempre defini-lo.

Para obter mais informações, veja Obter a Sua Conta e IDs de Cliente.
cadeia
CustomerId O identificador da conta de gestor (cliente) a partir da qual o utilizador está a aceder ou a operar. Um utilizador pode ter acesso a várias contas de gestor. Este elemento é necessário para a maioria das operações de serviço e, como melhor prática, deve sempre defini-lo.

Para obter mais informações, veja Obter a Sua Conta e IDs de Cliente.
cadeia
DeveloperToken O token de programador utilizado para aceder à API de Anúncios do Bing.

Para obter mais informações, veja Obter um Token de Programador.
cadeia
Palavra-passe Este elemento está reservado para utilização interna e será removido de uma versão futura da API. Tem de utilizar o elemento AuthenticationToken para definir credenciais de utilizador. cadeia
Nome de Utilizador Este elemento está reservado para utilização interna e será removido de uma versão futura da API. Tem de utilizar o elemento AuthenticationToken para definir credenciais de utilizador. cadeia

Elementos de Resposta

O objeto UpdateCampaignCriterionsResponse define os elementos do corpo e do cabeçalho da resposta da operação do serviço. Os elementos são devolvidos pela mesma ordem mostrada no SOAP de Resposta.

Elementos do Corpo da Resposta

Elemento Descrição Tipo de Dados
NestedPartialErrors Uma matriz de objetos BatchErrorCollection que contêm detalhes para qualquer critério que não tenha sido atualizado com êxito. O erro de nível superior em cada objeto BatchErrorCollection corresponde a potenciais erros de critério. A lista aninhada de objetos BatchError incluiria quaisquer erros específicos da lista de itens que um critério pode ter, por exemplo, uma lista de condições do produto.

A lista de erros não corresponde diretamente à lista de itens no pedido. A lista pode estar vazia se não existirem erros ou pode incluir um ou mais objetos de erro correspondentes a cada item de lista sem êxito no pedido.
Matriz BatchErrorCollection

Elementos do Cabeçalho de Resposta

Elemento Descrição Tipo de Dados
TrackingId O identificador da entrada de registo que contém os detalhes da chamada à API. cadeia

Pedir SOAP

Este modelo foi gerado por uma ferramenta para mostrar a ordem dos elementos do corpo e do cabeçalho do pedido SOAP. Para tipos suportados que pode utilizar com esta operação de serviço, veja a referência Request Body Elements (Elementos do Corpo do Pedido ) acima.

<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">UpdateCampaignCriterions</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>
    <UpdateCampaignCriterionsRequest xmlns="https://bingads.microsoft.com/CampaignManagement/v13">
      <CampaignCriterions i:nil="false">
        <CampaignCriterion i:type="-- derived type specified here with the appropriate prefix --">
          <CampaignId>ValueHere</CampaignId>
          <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>
          </Criterion>
          <ForwardCompatibilityMap xmlns:e196="http://schemas.datacontract.org/2004/07/System.Collections.Generic" i:nil="false">
            <e196:KeyValuePairOfstringstring>
              <e196:key i:nil="false">ValueHere</e196:key>
              <e196:value i:nil="false">ValueHere</e196:value>
            </e196:KeyValuePairOfstringstring>
          </ForwardCompatibilityMap>
          <Id i:nil="false">ValueHere</Id>
          <Status i:nil="false">ValueHere</Status>
          <Type i:nil="false">ValueHere</Type>
          <!--No additional fields are applicable if the derived type attribute is set to NegativeCampaignCriterion-->
          <!--These fields are applicable if the derived type attribute is set to BiddableCampaignCriterion-->
          <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>
          <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>
        </CampaignCriterion>
      </CampaignCriterions>
      <CriterionType>ValueHere</CriterionType>
    </UpdateCampaignCriterionsRequest>
  </s:Body>
</s:Envelope>

Soap de Resposta

Este modelo foi gerado por uma ferramenta para mostrar a ordem dos elementos do corpo e do cabeçalho para a resposta 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>
    <UpdateCampaignCriterionsResponse xmlns="https://bingads.microsoft.com/CampaignManagement/v13">
      <NestedPartialErrors d4p1:nil="false" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">
        <BatchErrorCollection d4p1:type="-- derived type specified here with the appropriate prefix --">
          <BatchErrors d4p1:nil="false">
            <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:e197="http://schemas.datacontract.org/2004/07/System.Collections.Generic" d4p1:nil="false">
                <e197:KeyValuePairOfstringstring>
                  <e197:key d4p1:nil="false">ValueHere</e197:key>
                  <e197:value d4p1:nil="false">ValueHere</e197:value>
                </e197: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>
          </BatchErrors>
          <Code d4p1:nil="false">ValueHere</Code>
          <Details d4p1:nil="false">ValueHere</Details>
          <ErrorCode d4p1:nil="false">ValueHere</ErrorCode>
          <FieldPath d4p1:nil="false">ValueHere</FieldPath>
          <ForwardCompatibilityMap xmlns:e198="http://schemas.datacontract.org/2004/07/System.Collections.Generic" d4p1:nil="false">
            <e198:KeyValuePairOfstringstring>
              <e198:key d4p1:nil="false">ValueHere</e198:key>
              <e198:value d4p1:nil="false">ValueHere</e198:value>
            </e198: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 EditorialErrorCollection-->
          <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>
        </BatchErrorCollection>
      </NestedPartialErrors>
    </UpdateCampaignCriterionsResponse>
  </s:Body>
</s:Envelope>

Sintaxe de Código

A sintaxe de exemplo pode ser utilizada com os SDKs de Anúncios do Bing. Veja Exemplos de Código da API de Anúncios do Bing para obter mais exemplos.

public async Task<UpdateCampaignCriterionsResponse> UpdateCampaignCriterionsAsync(
	IList<CampaignCriterion> campaignCriterions,
	CampaignCriterionType criterionType)
{
	var request = new UpdateCampaignCriterionsRequest
	{
		CampaignCriterions = campaignCriterions,
		CriterionType = criterionType
	};

	return (await CampaignManagementService.CallAsync((s, r) => s.UpdateCampaignCriterionsAsync(r), request));
}
static UpdateCampaignCriterionsResponse updateCampaignCriterions(
	ArrayOfCampaignCriterion campaignCriterions,
	ArrayList<CampaignCriterionType> criterionType) throws RemoteException, Exception
{
	UpdateCampaignCriterionsRequest request = new UpdateCampaignCriterionsRequest();

	request.setCampaignCriterions(campaignCriterions);
	request.setCriterionType(criterionType);

	return CampaignManagementService.getService().updateCampaignCriterions(request);
}
static function UpdateCampaignCriterions(
	$campaignCriterions,
	$criterionType)
{

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

	$request = new UpdateCampaignCriterionsRequest();

	$request->CampaignCriterions = $campaignCriterions;
	$request->CriterionType = $criterionType;

	return $GLOBALS['CampaignManagementProxy']->GetService()->UpdateCampaignCriterions($request);
}
response=campaignmanagement_service.UpdateCampaignCriterions(
	CampaignCriterions=CampaignCriterions,
	CriterionType=CriterionType)

Requisitos

Serviço: CampaignManagementService.svc v13
Espaço de nomes: https://bingads.microsoft.com/CampaignManagement/v13