Share via


Operación del servicio UpdateCampaignCriterions: Administración de campañas

Novedades uno o varios criterios de campaña.

Elementos Request

El objeto UpdateCampaignCriterionsRequest define los elementos body y header de la solicitud de operación de servicio. Los elementos deben estar en el mismo orden que se muestra en la solicitud SOAP.

Nota:

A menos que se indique lo contrario a continuación, se requieren todos los elementos de solicitud.

Elementos del cuerpo de la solicitud

Elemento Descripción Tipo de datos
CampaignCriterions Lista de criterios de campaña que se van a actualizar.

Puede incluir hasta 100 criterios de campaña por solicitud.

Dentro de cada objeto CampaignCriterion , debe especificar el identificador del criterio y el identificador de la campaña a la que pertenece.
Matriz CampaignCriterion
CriterionType Tipo de criterio que se va a actualizar, por ejemplo, página web. Solo puede especificar un valor de tipo de criterio por llamada.

Para agregar, eliminar o actualizar los criterios de destino, es decir, la edad, el día y la hora, el dispositivo, el sexo, la ubicación, la intención de ubicación y los criterios de radio, debe especificar el valor CriterionType como Destinos. Puede agregar, eliminar y actualizar varios tipos de criterio de destino en la misma operación. Para recuperar estos criterios de destino a través de GetCampaignCriterionsByIds , debe solicitar el tipo específico individualmente, es decir, Age, DayTime, Device, Gender, Location, LocationIntent y Radius.
CampaignCriterionType

Elementos de encabezado de solicitud

Elemento Descripción Tipo de datos
AuthenticationToken Token de acceso de OAuth que representa las credenciales de un usuario que tiene permisos para cuentas de Microsoft Advertising.

Para obtener más información, consulte Autenticación con OAuth.
string
CustomerAccountId Identificador de la cuenta de anuncio que posee o está asociada a las entidades de la solicitud. Este elemento de encabezado debe tener el mismo valor que el elemento de cuerpo AccountId cuando ambos son necesarios. Este elemento es necesario para la mayoría de las operaciones de servicio y, como procedimiento recomendado, siempre debe establecerlo.

Para obtener más información, consulte Obtención de su cuenta e identificadores de cliente.
string
Customerid Identificador de la cuenta de administrador (cliente) desde la que el usuario accede o funciona. Un usuario puede tener acceso a varias cuentas de administrador. Este elemento es necesario para la mayoría de las operaciones de servicio y, como procedimiento recomendado, siempre debe establecerlo.

Para obtener más información, consulte Obtención de su cuenta e identificadores de cliente.
string
DeveloperToken Token de desarrollador que se usa para acceder a Bing Ads API.

Para obtener más información, consulte Obtención de un token de desarrollador.
string
Password Este elemento está reservado para uso interno y se quitará de una versión futura de la API. Debe usar el elemento AuthenticationToken para establecer las credenciales de usuario. string
UserName Este elemento está reservado para uso interno y se quitará de una versión futura de la API. Debe usar el elemento AuthenticationToken para establecer las credenciales de usuario. string

Elementos de respuesta

El objeto UpdateCampaignCriterionsResponse define los elementos body y header de la respuesta de la operación de servicio. Los elementos se devuelven en el mismo orden que se muestra en soap de respuesta.

Elementos del cuerpo de la respuesta

Elemento Descripción Tipo de datos
NestedPartialErrors Matriz de objetos BatchErrorCollection que contienen detalles para cualquier criterio que no se haya actualizado correctamente. El error de nivel superior dentro de cada objeto BatchErrorCollection corresponde a posibles errores de criterio. La lista anidada de objetos BatchError incluiría los errores específicos de la lista de elementos que un criterio puede tener, por ejemplo, una lista de condiciones de producto.

La lista de errores no se corresponde directamente con la lista de elementos de la solicitud. La lista puede estar vacía si no hay errores o puede incluir uno o varios objetos de error correspondientes a cada elemento de lista incorrecto en la solicitud.
Matriz BatchErrorCollection

Elementos de encabezado de respuesta

Elemento Descripción Tipo de datos
Seguimiento del Id. Identificador de la entrada de registro que contiene los detalles de la llamada API. string

Solicitud de SOAP

Esta plantilla se generó mediante una herramienta para mostrar el orden del cuerpo y los elementos de encabezado de la solicitud SOAP. Para ver los tipos admitidos que puede usar con esta operación de servicio, consulte la referencia de elementos de cuerpo de solicitud anterior.

<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 respuesta

Esta plantilla se generó mediante una herramienta para mostrar el orden de los elementos body y header para la respuesta 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>

Sintaxis de código

La sintaxis de ejemplo se puede usar con los SDK de Bing Ads. Consulte Ejemplos de código de API de Bing Ads para obtener más ejemplos.

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

Servicio: CampaignManagementService.svc v13
Nombres: https://bingads.microsoft.com/CampaignManagement/v13