UpdateCampaignCriterions 服务操作 - 市场活动管理
汇报一个或多个市场活动条件。
请求元素
UpdateCampaignCriterionsRequest 对象定义服务操作请求的正文和标头元素。 元素的顺序必须与 请求 SOAP 中所示的顺序相同。
注意
除非下面另有说明,否则需要所有请求元素。
请求正文元素
元素 | 说明 | 数据类型 |
---|---|---|
CampaignCriterions | 要更新的活动条件列表。 每个请求最多可以包含 100 个市场活动条件。 在每个 CampaignCriterion 对象中,必须指定条件的 ID 及其所属市场活动的 ID。 |
CampaignCriterion 数组 |
CriterionType | 要更新的条件类型,例如 网页。 每次调用只能指定一个条件类型值。 若要添加、删除或更新目标条件(例如年龄、日期和时间、设备、性别、位置、位置意向和半径条件),必须将 CriterionType 值指定为 Targets。 可以在同一操作中添加、删除和更新多个目标条件类型。 若要通过 GetCampaignCriterionsByIds 检索这些目标条件,必须单独请求特定类型,即 Age、 DayTime、 Device、 Gender、 Location、 LocationIntent 和 Radius。 |
CampaignCriterionType |
请求标头元素
元素 | 说明 | 数据类型 |
---|---|---|
AuthenticationToken | OAuth 访问令牌,表示有权Microsoft广告帐户的用户的凭据。 有关详细信息,请参阅 使用 OAuth 进行身份验证。 |
string |
CustomerAccountId | 拥有或与请求中的实体关联的广告帐户的标识符。 如果需要这两个元素,此标头元素必须与 AccountId 正文元素具有相同的值。 此元素是大多数服务操作所必需的,作为最佳做法,应始终设置它。 有关详细信息,请参阅 获取帐户和客户 ID。 |
string |
CustomerId | 用户正在访问或操作的客户) 经理帐户 (标识符。 用户可以访问多个经理帐户。 此元素是大多数服务操作所必需的,作为最佳做法,应始终设置它。 有关详细信息,请参阅 获取帐户和客户 ID。 |
string |
DeveloperToken | 用于访问必应广告 API 的开发人员令牌。 有关详细信息,请参阅 获取开发人员令牌。 |
string |
Password | 此元素保留供内部使用,将从 API 的未来版本中删除。 必须使用 AuthenticationToken 元素来设置用户凭据。 | string |
UserName | 此元素保留供内部使用,将从 API 的未来版本中删除。 必须使用 AuthenticationToken 元素来设置用户凭据。 | string |
响应元素
UpdateCampaignCriterionsResponse 对象定义服务操作响应的正文和标头元素。 元素的返回顺序与 响应 SOAP 中所示的顺序相同。
响应正文元素
元素 | 说明 | 数据类型 |
---|---|---|
NestedPartialErrors |
BatchErrorCollection 对象的数组,其中包含未成功更新的任何条件的详细信息。 每个 BatchErrorCollection 对象中的顶级错误对应于潜在的条件错误。
BatchError 对象的嵌套列表将包括特定于条件可能具有的项列表的任何错误,例如产品条件列表。 错误列表与请求中的项列表不直接对应。 如果没有错误,列表可以为空,也可以包含与请求中每个不成功的列表项对应的一个或多个错误对象。 |
BatchErrorCollection 数组 |
响应标头元素
元素 | 说明 | 数据类型 |
---|---|---|
跟踪 ID | 包含 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">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>
<!--These fields are applicable if the derived type attribute is set to PlacementCriterion-->
<PlacementId>ValueHere</PlacementId>
<PlacementName i:nil="false">ValueHere</PlacementName>
</Criterion>
<ForwardCompatibilityMap xmlns:e563="http://schemas.datacontract.org/2004/07/System.Collections.Generic" i:nil="false">
<e563:KeyValuePairOfstringstring>
<e563:key i:nil="false">ValueHere</e563:key>
<e563:value i:nil="false">ValueHere</e563:value>
</e563: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
此模板由一个工具生成,用于显示 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:e564="http://schemas.datacontract.org/2004/07/System.Collections.Generic" d4p1:nil="false">
<e564:KeyValuePairOfstringstring>
<e564:key d4p1:nil="false">ValueHere</e564:key>
<e564:value d4p1:nil="false">ValueHere</e564:value>
</e564: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:e565="http://schemas.datacontract.org/2004/07/System.Collections.Generic" d4p1:nil="false">
<e565:KeyValuePairOfstringstring>
<e565:key d4p1:nil="false">ValueHere</e565:key>
<e565:value d4p1:nil="false">ValueHere</e565:value>
</e565: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>
代码语法
示例语法可用于 必应广告 SDK。 有关更多示例,请参阅 必应广告 API 代码示例 。
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)
要求
服务: CampaignManagementService.svc v13
命名空间: https://bingads.microsoft.com/CampaignManagement/v13
请求 URL
请求元素
UpdateCampaignCriterionsRequest 对象定义服务操作请求的正文和标头元素。
注意
除非下面另有说明,否则需要所有请求元素。
请求正文元素
元素 | 说明 | 数据类型 |
---|---|---|
CampaignCriterions | 要更新的活动条件列表。 每个请求最多可以包含 100 个市场活动条件。 在每个 CampaignCriterion 对象中,必须指定条件的 ID 及其所属市场活动的 ID。 |
CampaignCriterion 数组 |
CriterionType | 要更新的条件类型,例如 网页。 每次调用只能指定一个条件类型值。 若要添加、删除或更新目标条件(例如年龄、日期和时间、设备、性别、位置、位置意向和半径条件),必须将 CriterionType 值指定为 Targets。 可以在同一操作中添加、删除和更新多个目标条件类型。 若要通过 GetCampaignCriterionsByIds 检索这些目标条件,必须单独请求特定类型,即 Age、 DayTime、 Device、 Gender、 Location、 LocationIntent 和 Radius。 |
CampaignCriterionType |
请求标头元素
元素 | 说明 | 数据类型 |
---|---|---|
Authorization | OAuth 访问令牌,表示有权Microsoft广告帐户的用户的凭据。 请确保令牌的前缀为“持有者”,这是正确身份验证所必需的。 有关详细信息,请参阅 使用 OAuth 进行身份验证。 |
string |
CustomerAccountId | 拥有或与请求中的实体关联的广告帐户的标识符。 如果需要这两个元素,此标头元素必须与 AccountId 正文元素具有相同的值。 此元素是大多数服务操作所必需的,作为最佳做法,应始终设置它。 有关详细信息,请参阅 获取帐户和客户 ID。 |
string |
CustomerId | 用户正在访问或操作的客户) 经理帐户 (标识符。 用户可以访问多个经理帐户。 此元素是大多数服务操作所必需的,作为最佳做法,应始终设置它。 有关详细信息,请参阅 获取帐户和客户 ID。 |
string |
DeveloperToken | 用于访问必应广告 API 的开发人员令牌。 有关详细信息,请参阅 获取开发人员令牌。 |
string |
Password | 此元素保留供内部使用,将从 API 的未来版本中删除。 必须使用 AuthenticationToken 元素来设置用户凭据。 | string |
UserName | 此元素保留供内部使用,将从 API 的未来版本中删除。 必须使用 AuthenticationToken 元素来设置用户凭据。 | string |
响应元素
UpdateCampaignCriterionsResponse 对象定义服务操作响应的正文和标头元素。 元素的返回顺序与 响应 JSON 中所示的顺序相同。
响应正文元素
元素 | 说明 | 数据类型 |
---|---|---|
NestedPartialErrors |
BatchErrorCollection 对象的数组,其中包含未成功更新的任何条件的详细信息。 每个 BatchErrorCollection 对象中的顶级错误对应于潜在的条件错误。
BatchError 对象的嵌套列表将包括特定于条件可能具有的项列表的任何错误,例如产品条件列表。 错误列表与请求中的项列表不直接对应。 如果没有错误,列表可以为空,也可以包含与请求中每个不成功的列表项对应的一个或多个错误对象。 |
BatchErrorCollection 数组 |
响应标头元素
元素 | 说明 | 数据类型 |
---|---|---|
跟踪 ID | 包含 API 调用详细信息的日志条目的标识符。 | string |
请求 JSON
此模板由显示 JSON 请求的 正文 和 标头 元素的工具生成。 有关可用于此服务操作的支持类型,请参阅上面的 请求正文元素 参考。
下面是一个示例,如果 CampaignCriterion 的类型为 BiddableCampaignCriterion,Criterion 为 AgeCriterion,CriterionBid 为 BidMultiplier,CriterionCashback 为 CashbackAdjustment,则适用。
{
"CampaignCriterions": [
{
"CampaignId": "LongValueHere",
"Criterion": {
"Type": "AgeCriterion",
"AgeRange": "ValueHere"
},
"ForwardCompatibilityMap": [
{
"key": "ValueHere",
"value": "ValueHere"
}
],
"Id": "LongValueHere",
"Status": "ValueHere",
"Type": "BiddableCampaignCriterion",
"CriterionBid": {
"Type": "BidMultiplier",
"Multiplier": DoubleValueHere
},
"CriterionCashback": {
"Type": "CashbackAdjustment",
"CashbackPercent": DoubleValueHere
}
}
],
"CriterionType": "ValueHere"
}
响应 JSON
此模板由一个工具生成,用于显示 JSON 响应的 正文 和 标头 元素。
以下示例适用于 BatchErrorCollection 的类型为 EditorialErrorCollection,BatchError 为 EditorialError。
{
"NestedPartialErrors": [
{
"BatchErrors": [
{
"Code": IntValueHere,
"Details": "ValueHere",
"ErrorCode": "ValueHere",
"FieldPath": "ValueHere",
"ForwardCompatibilityMap": [
{
"key": "ValueHere",
"value": "ValueHere"
}
],
"Index": IntValueHere,
"Message": "ValueHere",
"Type": "EditorialError",
"Appealable": "ValueHere",
"DisapprovedText": "ValueHere",
"Location": "ValueHere",
"PublisherCountry": "ValueHere",
"ReasonCode": IntValueHere
}
],
"Code": IntValueHere,
"Details": "ValueHere",
"ErrorCode": "ValueHere",
"FieldPath": "ValueHere",
"ForwardCompatibilityMap": [
{
"key": "ValueHere",
"value": "ValueHere"
}
],
"Index": IntValueHere,
"Message": "ValueHere",
"Type": "EditorialErrorCollection",
"Appealable": "ValueHere",
"DisapprovedText": "ValueHere",
"Location": "ValueHere",
"PublisherCountry": "ValueHere",
"ReasonCode": IntValueHere
}
]
}
代码语法
若要通过 SDK 调用 REST API,需要将 SDK 升级到特定版本并配置系统参数。示例语法可用于 必应广告 SDK。 有关更多示例,请参阅 必应广告 API 代码示例 。
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)