การดําเนินการบริการ GetAudiencesByIds - การจัดการแคมเปญ
เรียกใช้ผู้ชมที่ระบุจากบัญชีผู้ใช้ที่ระบุ
ร้องขอองค์ประกอบ
วัตถุ GetAudiencesByIdsRequest กําหนดองค์ประกอบ เนื้อความ และ ส่วนหัว ของการร้องขอการดําเนินการบริการ องค์ประกอบต้องอยู่ในลําดับเดียวกับที่แสดงใน Request SOAP
หมายเหตุ
เว้นแต่ระบุไว้เป็นอย่างอื่นด้านล่าง จําเป็นต้องระบุองค์ประกอบคําขอทั้งหมด
ร้องขอองค์ประกอบเนื้อความ
องค์ ประกอบ | คำอธิบาย | ชนิดข้อมูล |
---|---|---|
AudienceIds | ตัวระบุผู้ชมที่ร้องขอได้สูงสุด 100 ตัว องค์ประกอบการร้องขอนี้เป็นทางเลือก ถ้าองค์ประกอบนี้เป็น Null หรือค่าว่าง แสดงว่าคุณกําลังร้องขอลูกค้าและลูกค้าที่มีขอบเขตบัญชีทั้งหมดสําหรับบัญชีที่ระบุได้อย่างมีประสิทธิภาพ ถ้าตัวระบุผู้ชมไม่ตรงกับชนิดผู้ชมที่ร้องขอ การดําเนินการจะส่งกลับข้อผิดพลาดชุดงานสําหรับแต่ละ ID ผู้ชมที่ร้องขอ |
อาร์เรย์ยาว |
ReturnAdditionalFields | ค่าเขตข้อมูลเพิ่มเติมช่วยให้คุณสามารถรับคุณลักษณะล่าสุดโดยใช้ API การจัดการแคมเปญเวอร์ชันปัจจุบัน และในเวอร์ชันถัดไป องค์ประกอบที่สอดคล้องกันจะถูกรวมไว้ตามค่าเริ่มต้น องค์ประกอบการร้องขอนี้เป็นทางเลือก |
AudienceAdditionalField |
ชนิด | ชนิดของผู้ชมที่จะส่งกลับ คุณอาจรวมค่าหลายค่าเป็นค่าสถานะได้ วิธีที่คุณระบุค่าสถานะหลายรายการขึ้นอยู่กับภาษาการเขียนโปรแกรมที่คุณใช้ ตัวอย่างเช่น C# ถือว่าค่าเหล่านี้เป็นค่าสถานะ และ Java ถือว่าเป็นอาร์เรย์ของสตริง SOAP ควรมีสตริงที่ประกอบด้วยรายการค่าที่คั่นด้วยช่องว่าง ตัวอย่างเช่น <Type>RemarketingList SimilarRemarketingList</Type> |
AudienceType |
องค์ประกอบส่วนหัวของคําขอ
องค์ ประกอบ | คำอธิบาย | ชนิดข้อมูล |
---|---|---|
AuthenticationToken | โทเค็นการเข้าถึง OAuth ที่แสดงข้อมูลประจําตัวของผู้ใช้ที่มีสิทธิ์เข้าถึงบัญชี Microsoft Advertising สําหรับข้อมูลเพิ่มเติม ดูการรับรองความถูกต้องด้วย OAuth |
สาย อักขระ |
CustomerAccountId | ตัวระบุบัญชีโฆษณาที่เป็นเจ้าของหรือเชื่อมโยงกับเอนทิตีในคําขอ องค์ประกอบส่วนหัวนี้ต้องมีค่าเดียวกันกับองค์ประกอบเนื้อความ AccountId เมื่อต้องการทั้งสองอย่าง องค์ประกอบนี้จําเป็นสําหรับการดําเนินการบริการส่วนใหญ่ และเป็นแนวทางปฏิบัติที่ดีที่สุดที่คุณควรตั้งค่าไว้เสมอ สําหรับข้อมูลเพิ่มเติม ดูรับบัญชีและรหัสลูกค้าของคุณ |
สาย อักขระ |
CustomerId | ตัวระบุบัญชีผู้จัดการ (ลูกค้า) ที่ผู้ใช้กําลังเข้าถึงหรือดําเนินการ ผู้ใช้สามารถเข้าถึงบัญชีผู้จัดการได้หลายบัญชี องค์ประกอบนี้จําเป็นสําหรับการดําเนินการบริการส่วนใหญ่ และเป็นแนวทางปฏิบัติที่ดีที่สุดที่คุณควรตั้งค่าไว้เสมอ สําหรับข้อมูลเพิ่มเติม ดูรับบัญชีและรหัสลูกค้าของคุณ |
สาย อักขระ |
DeveloperToken | โทเค็นนักพัฒนาที่ใช้เพื่อเข้าถึง Bing Ads API สําหรับข้อมูลเพิ่มเติม ดูรับโทเค็นนักพัฒนา |
สาย อักขระ |
รหัส ผ่าน | องค์ประกอบนี้สงวนไว้สําหรับการใช้ภายในและจะถูกเอาออกจากเวอร์ชันในอนาคตของ API คุณต้องใช้องค์ประกอบ AuthenticationToken เพื่อตั้งค่าข้อมูลประจําตัวของผู้ใช้ | สาย อักขระ |
ชื่อ | องค์ประกอบนี้สงวนไว้สําหรับการใช้ภายในและจะถูกเอาออกจากเวอร์ชันในอนาคตของ API คุณต้องใช้องค์ประกอบ AuthenticationToken เพื่อตั้งค่าข้อมูลประจําตัวของผู้ใช้ | สาย อักขระ |
องค์ประกอบการตอบสนอง
วัตถุ GetAudiencesByIdsResponse จะกําหนดองค์ประกอบ เนื้อ ความและ ส่วนหัว ของการตอบสนองการดําเนินการบริการ องค์ประกอบจะถูกส่งกลับตามลําดับเดียวกับที่แสดงใน Response SOAP
องค์ประกอบเนื้อความการตอบสนอง
องค์ ประกอบ | คำอธิบาย | ชนิดข้อมูล |
---|---|---|
ผู้ชม | รายการของผู้ชมที่สอดคล้องกับตัวระบุผู้ชมที่คุณระบุไว้ในคําขอโดยตรง ข้อมูลในรายการอาจถูกส่งกลับเป็น Null สําหรับแต่ละดัชนีรายการที่ไม่มีการเรียกใช้ผู้ชม องค์ประกอบที่สอดคล้องกันจะเป็น Null | อาร์เรย์ผู้ชม |
ตัวแก้ไขบางส่วน | อาร์เรย์ของออบเจ็กต์ BatchError ที่มีรายละเอียดสําหรับรายการคําขอใดๆ ที่ไม่ประสบความสําเร็จ รายการของข้อผิดพลาดไม่สอดคล้องกับรายการของหน่วยข้อมูลในคําขอโดยตรง รายการอาจว่างเปล่าถ้าไม่มีข้อผิดพลาด หรืออาจรวมวัตถุข้อผิดพลาดอย่างน้อยหนึ่งวัตถุที่สอดคล้องกับข้อมูลในรายการที่ไม่สําเร็จแต่ละรายการในการร้องขอ |
อาร์เรย์ BatchError |
องค์ประกอบส่วนหัวการตอบสนอง
องค์ ประกอบ | คำอธิบาย | ชนิดข้อมูล |
---|---|---|
TrackingId | ตัวระบุของรายการบันทึกที่ประกอบด้วยรายละเอียดของการเรียกใช้ API | สาย อักขระ |
ร้องขอ 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">GetAudiencesByIds</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>
<GetAudiencesByIdsRequest xmlns="https://bingads.microsoft.com/CampaignManagement/v13">
<AudienceIds i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<a1:long>ValueHere</a1:long>
</AudienceIds>
<Type>ValueHere</Type>
<ReturnAdditionalFields i:nil="false">ValueHere</ReturnAdditionalFields>
</GetAudiencesByIdsRequest>
</s:Body>
</s:Envelope>
Response 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>
<GetAudiencesByIdsResponse xmlns="https://bingads.microsoft.com/CampaignManagement/v13">
<Audiences d4p1:nil="false" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">
<Audience d4p1:type="-- derived type specified here with the appropriate prefix --">
<AudienceNetworkSize d4p1:nil="false">ValueHere</AudienceNetworkSize>
<CustomerShare d4p1:nil="false">
<CustomerAccountShares d4p1:nil="false">
<CustomerAccountShare>
<AccountId d4p1:nil="false">ValueHere</AccountId>
<Associations d4p1:nil="false">
<CustomerAccountShareAssociation>
<AssociationCount d4p1:nil="false">ValueHere</AssociationCount>
<UsageType d4p1:nil="false">ValueHere</UsageType>
</CustomerAccountShareAssociation>
</Associations>
<CustomerId d4p1:nil="false">ValueHere</CustomerId>
</CustomerAccountShare>
</CustomerAccountShares>
<OwnerCustomerId d4p1:nil="false">ValueHere</OwnerCustomerId>
</CustomerShare>
<Description d4p1:nil="false">ValueHere</Description>
<ForwardCompatibilityMap xmlns:e126="http://schemas.datacontract.org/2004/07/System.Collections.Generic" d4p1:nil="false">
<e126:KeyValuePairOfstringstring>
<e126:key d4p1:nil="false">ValueHere</e126:key>
<e126:value d4p1:nil="false">ValueHere</e126:value>
</e126:KeyValuePairOfstringstring>
</ForwardCompatibilityMap>
<Id d4p1:nil="false">ValueHere</Id>
<MembershipDuration d4p1:nil="false">ValueHere</MembershipDuration>
<Name d4p1:nil="false">ValueHere</Name>
<ParentId d4p1:nil="false">ValueHere</ParentId>
<Scope d4p1:nil="false">ValueHere</Scope>
<SearchSize d4p1:nil="false">ValueHere</SearchSize>
<SupportedCampaignTypes d4p1:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<a1:string>ValueHere</a1:string>
</SupportedCampaignTypes>
<Type>ValueHere</Type>
<!--These fields are applicable if the derived type attribute is set to RemarketingList-->
<Rule d4p1:nil="false" d4p1:type="-- derived type specified here with the appropriate prefix --">
<Type d4p1:nil="false">ValueHere</Type>
<!--These fields are applicable if the derived type attribute is set to PageVisitorsRule-->
<NormalForm d4p1:nil="false">ValueHere</NormalForm>
<RuleItemGroups d4p1:nil="false">
<RuleItemGroup>
<Items d4p1:nil="false">
<RuleItem d4p1:type="-- derived type specified here with the appropriate prefix --">
<Type d4p1:nil="false">ValueHere</Type>
<!--These fields are applicable if the derived type attribute is set to StringRuleItem-->
<Operand d4p1:nil="false">ValueHere</Operand>
<Operator>ValueHere</Operator>
<Value d4p1:nil="false">ValueHere</Value>
<!--These fields are applicable if the derived type attribute is set to NumberRuleItem-->
<Operand d4p1:nil="false">ValueHere</Operand>
<Operator>ValueHere</Operator>
<Value d4p1:nil="false">ValueHere</Value>
</RuleItem>
</Items>
</RuleItemGroup>
</RuleItemGroups>
<!--These fields are applicable if the derived type attribute is set to PageVisitorsWhoVisitedAnotherPageRule-->
<AnotherRuleItemGroups d4p1:nil="false">
<RuleItemGroup>
<Items d4p1:nil="false">
<RuleItem d4p1:type="-- derived type specified here with the appropriate prefix --">
<Type d4p1:nil="false">ValueHere</Type>
<!--These fields are applicable if the derived type attribute is set to StringRuleItem-->
<Operand d4p1:nil="false">ValueHere</Operand>
<Operator>ValueHere</Operator>
<Value d4p1:nil="false">ValueHere</Value>
<!--These fields are applicable if the derived type attribute is set to NumberRuleItem-->
<Operand d4p1:nil="false">ValueHere</Operand>
<Operator>ValueHere</Operator>
<Value d4p1:nil="false">ValueHere</Value>
</RuleItem>
</Items>
</RuleItemGroup>
</AnotherRuleItemGroups>
<RuleItemGroups d4p1:nil="false">
<RuleItemGroup>
<Items d4p1:nil="false">
<RuleItem d4p1:type="-- derived type specified here with the appropriate prefix --">
<Type d4p1:nil="false">ValueHere</Type>
<!--These fields are applicable if the derived type attribute is set to StringRuleItem-->
<Operand d4p1:nil="false">ValueHere</Operand>
<Operator>ValueHere</Operator>
<Value d4p1:nil="false">ValueHere</Value>
<!--These fields are applicable if the derived type attribute is set to NumberRuleItem-->
<Operand d4p1:nil="false">ValueHere</Operand>
<Operator>ValueHere</Operator>
<Value d4p1:nil="false">ValueHere</Value>
</RuleItem>
</Items>
</RuleItemGroup>
</RuleItemGroups>
<!--These fields are applicable if the derived type attribute is set to PageVisitorsWhoDidNotVisitAnotherPageRule-->
<ExcludeRuleItemGroups d4p1:nil="false">
<RuleItemGroup>
<Items d4p1:nil="false">
<RuleItem d4p1:type="-- derived type specified here with the appropriate prefix --">
<Type d4p1:nil="false">ValueHere</Type>
<!--These fields are applicable if the derived type attribute is set to StringRuleItem-->
<Operand d4p1:nil="false">ValueHere</Operand>
<Operator>ValueHere</Operator>
<Value d4p1:nil="false">ValueHere</Value>
<!--These fields are applicable if the derived type attribute is set to NumberRuleItem-->
<Operand d4p1:nil="false">ValueHere</Operand>
<Operator>ValueHere</Operator>
<Value d4p1:nil="false">ValueHere</Value>
</RuleItem>
</Items>
</RuleItemGroup>
</ExcludeRuleItemGroups>
<IncludeRuleItemGroups d4p1:nil="false">
<RuleItemGroup>
<Items d4p1:nil="false">
<RuleItem d4p1:type="-- derived type specified here with the appropriate prefix --">
<Type d4p1:nil="false">ValueHere</Type>
<!--These fields are applicable if the derived type attribute is set to StringRuleItem-->
<Operand d4p1:nil="false">ValueHere</Operand>
<Operator>ValueHere</Operator>
<Value d4p1:nil="false">ValueHere</Value>
<!--These fields are applicable if the derived type attribute is set to NumberRuleItem-->
<Operand d4p1:nil="false">ValueHere</Operand>
<Operator>ValueHere</Operator>
<Value d4p1:nil="false">ValueHere</Value>
</RuleItem>
</Items>
</RuleItemGroup>
</IncludeRuleItemGroups>
<!--These fields are applicable if the derived type attribute is set to CustomEventsRule-->
<Action d4p1:nil="false">ValueHere</Action>
<ActionOperator>ValueHere</ActionOperator>
<Category d4p1:nil="false">ValueHere</Category>
<CategoryOperator>ValueHere</CategoryOperator>
<Label d4p1:nil="false">ValueHere</Label>
<LabelOperator>ValueHere</LabelOperator>
<Value d4p1:nil="false">ValueHere</Value>
<ValueOperator>ValueHere</ValueOperator>
</Rule>
<TagId d4p1:nil="false">ValueHere</TagId>
<!--No additional fields are applicable if the derived type attribute is set to CustomAudience-->
<!--No additional fields are applicable if the derived type attribute is set to InMarketAudience-->
<!--These fields are applicable if the derived type attribute is set to ProductAudience-->
<ProductAudienceType d4p1:nil="false">ValueHere</ProductAudienceType>
<TagId d4p1:nil="false">ValueHere</TagId>
<!--This field is applicable if the derived type attribute is set to SimilarRemarketingList-->
<SourceId>ValueHere</SourceId>
<!--This field is applicable if the derived type attribute is set to CombinedList-->
<CombinationRules d4p1:nil="false">
<CombinationRule>
<AudienceIds d4p1:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<a1:long>ValueHere</a1:long>
</AudienceIds>
<Operator>ValueHere</Operator>
</CombinationRule>
</CombinationRules>
<!--No additional fields are applicable if the derived type attribute is set to CustomerList-->
<!--These fields are applicable if the derived type attribute is set to ImpressionBasedRemarketingList-->
<AdGroupId d4p1:nil="false">ValueHere</AdGroupId>
<CampaignId d4p1:nil="false">ValueHere</CampaignId>
<EntityType>ValueHere</EntityType>
</Audience>
</Audiences>
<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:e127="http://schemas.datacontract.org/2004/07/System.Collections.Generic" d4p1:nil="false">
<e127:KeyValuePairOfstringstring>
<e127:key d4p1:nil="false">ValueHere</e127:key>
<e127:value d4p1:nil="false">ValueHere</e127:value>
</e127: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>
</GetAudiencesByIdsResponse>
</s:Body>
</s:Envelope>
ไวยากรณ์โค้ด
ไวยากรณ์ตัวอย่างสามารถใช้กับ Bing Ads SDKs ได้ ดู ตัวอย่างโค้ด API ของโฆษณา Bing สําหรับตัวอย่างเพิ่มเติม
public async Task<GetAudiencesByIdsResponse> GetAudiencesByIdsAsync(
IList<long> audienceIds,
AudienceType type,
AudienceAdditionalField? returnAdditionalFields)
{
var request = new GetAudiencesByIdsRequest
{
AudienceIds = audienceIds,
Type = type,
ReturnAdditionalFields = returnAdditionalFields
};
return (await CampaignManagementService.CallAsync((s, r) => s.GetAudiencesByIdsAsync(r), request));
}
static GetAudiencesByIdsResponse getAudiencesByIds(
ArrayOflong audienceIds,
ArrayList<AudienceType> type,
ArrayList<AudienceAdditionalField> returnAdditionalFields) throws RemoteException, Exception
{
GetAudiencesByIdsRequest request = new GetAudiencesByIdsRequest();
request.setAudienceIds(audienceIds);
request.setType(type);
request.setReturnAdditionalFields(returnAdditionalFields);
return CampaignManagementService.getService().getAudiencesByIds(request);
}
static function GetAudiencesByIds(
$audienceIds,
$type,
$returnAdditionalFields)
{
$GLOBALS['Proxy'] = $GLOBALS['CampaignManagementProxy'];
$request = new GetAudiencesByIdsRequest();
$request->AudienceIds = $audienceIds;
$request->Type = $type;
$request->ReturnAdditionalFields = $returnAdditionalFields;
return $GLOBALS['CampaignManagementProxy']->GetService()->GetAudiencesByIds($request);
}
response=campaignmanagement_service.GetAudiencesByIds(
AudienceIds=AudienceIds,
Type=Type,
ReturnAdditionalFields=ReturnAdditionalFields)
ข้อกําหนด
บริการ: การส่งเสริมการขายการจัดการบริการ.svc v13
Namespace: https://bingads.microsoft.com/CampaignManagement/v13