SearchCoupons 服務作業 - 客戶計費
搜尋符合指定準則的優待券。
要求專案
SearchCouponsRequest物件會定義服務作業要求的主體和標頭元素。 元素的順序必須與 要求 SOAP中所示的順序相同。
注意事項
除非下面另有說明,否則所有要求專案都是必要的。
要求本文專案
元素 | 說明 | 資料類型 |
---|---|---|
訂購 | 根據優待券的指定屬性來決定結果的順序。 您應該只在陣列中指定一個 OrderBy 元素。 不支援其他專案,服務將會忽略這些專案。 針對此服務作業,OrderBy物件的Field元素支援下列值。 ClassName - 順序是由傳回之Coupon的ClassName元素所決定。 StartDate - 順序取決於傳回之Coupon的StartDate元素。 |
OrderBy 數 組 |
PageInfo | 決定每頁結果的索引和大小。 | 分頁 |
謂詞 | 決定要求條件。 此作業的回應將包含符合所有指定述詞的優待券。 您最多可以指定 4 個述詞,其中一個述詞欄位必須是 CustomerId。 如需此服務作業之Predicate物件支援的Field和Operator元素清單,請參閱述詞備註。 |
述詞數 組 |
ReturnAdditionalFields | 如果設定為 「CouponClaimInfo」,請在回應中傳回 CouponClaimInfo 。 | AccountAdditionalField |
要求標頭元素
元素 | 說明 | 資料類型 |
---|---|---|
AuthenticationToken | OAuth 存取權杖,代表具有 Microsoft Advertising 帳戶許可權之使用者的認證。 如需詳細資訊,請 參閱使用 OAuth 進行驗證。 |
string |
DeveloperToken | 用來存取 Bing 廣告 API 的開發人員權杖。 如需詳細資訊 ,請參閱取得開發人員權杖。 |
string |
密碼 | 此元素會保留供內部使用,並會從未來的 API 版本中移除。 您必須使用 AuthenticationToken 元素來設定使用者認證。 | string |
UserName | 此元素會保留供內部使用,並會從未來的 API 版本中移除。 您必須使用 AuthenticationToken 元素來設定使用者認證。 | string |
Response 元素
SearchCouponsResponse物件會定義服務作業回應的主體和標頭元素。 這些元素的傳回順序與 回應 SOAP中所示的順序相同。
回應本文專案
元素 | 說明 | 資料類型 |
---|---|---|
優惠 券 | 符合指定準則的優待券清單。 | 優待券數 組 |
回應標頭元素
元素 | 說明 | 資料類型 |
---|---|---|
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/Billing/v13">
<Action mustUnderstand="1">SearchCoupons</Action>
<AuthenticationToken i:nil="false">ValueHere</AuthenticationToken>
<DeveloperToken i:nil="false">ValueHere</DeveloperToken>
</s:Header>
<s:Body>
<SearchCouponsRequest xmlns="https://bingads.microsoft.com/Billing/v13">
<Predicates xmlns:e10="https://bingads.microsoft.com/Customer/v13/Entities" i:nil="false">
<e10:Predicate>
<e10:Field i:nil="false">ValueHere</e10:Field>
<e10:Operator>ValueHere</e10:Operator>
<e10:Value i:nil="false">ValueHere</e10:Value>
</e10:Predicate>
</Predicates>
<Ordering xmlns:e11="https://bingads.microsoft.com/Customer/v13/Entities" i:nil="false">
<e11:OrderBy>
<e11:Field>ValueHere</e11:Field>
<e11:Order>ValueHere</e11:Order>
</e11:OrderBy>
</Ordering>
<PageInfo xmlns:e12="https://bingads.microsoft.com/Customer/v13/Entities" i:nil="false">
<e12:Index>ValueHere</e12:Index>
<e12:Size>ValueHere</e12:Size>
</PageInfo>
<ReturnAdditionalFields i:nil="false">ValueHere</ReturnAdditionalFields>
</SearchCouponsRequest>
</s:Body>
</s:Envelope>
回應 SOAP
此範本是由工具所產生,用來顯示 SOAP 回應的 主體 和 標頭 元素順序。
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header xmlns="https://bingads.microsoft.com/Billing/v13">
<TrackingId d3p1:nil="false" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance">ValueHere</TrackingId>
</s:Header>
<s:Body>
<SearchCouponsResponse xmlns="https://bingads.microsoft.com/Billing/v13">
<Coupons xmlns:e13="https://bingads.microsoft.com/Customer/v13/Entities" d4p1:nil="false" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">
<e13:Coupon>
<e13:CouponCode d4p1:nil="false">ValueHere</e13:CouponCode>
<e13:ClassName d4p1:nil="false">ValueHere</e13:ClassName>
<e13:CouponType d4p1:nil="false">ValueHere</e13:CouponType>
<e13:Amount>ValueHere</e13:Amount>
<e13:SpendThreshold>ValueHere</e13:SpendThreshold>
<e13:CurrencyCode d4p1:nil="false">ValueHere</e13:CurrencyCode>
<e13:PercentOff d4p1:nil="false">ValueHere</e13:PercentOff>
<e13:ActiveDuration d4p1:nil="false">ValueHere</e13:ActiveDuration>
<e13:ExpirationDate d4p1:nil="false">ValueHere</e13:ExpirationDate>
<e13:StartDate d4p1:nil="false">ValueHere</e13:StartDate>
<e13:EndDate d4p1:nil="false">ValueHere</e13:EndDate>
<e13:SendToEmail d4p1:nil="false">ValueHere</e13:SendToEmail>
<e13:SendToDate d4p1:nil="false">ValueHere</e13:SendToDate>
<e13:IsRedeemed>ValueHere</e13:IsRedeemed>
<e13:RedemptionInfo d4p1:nil="false">
<e13:AccountId>ValueHere</e13:AccountId>
<e13:AccountNumber d4p1:nil="false">ValueHere</e13:AccountNumber>
<e13:SpendToThreshold>ValueHere</e13:SpendToThreshold>
<e13:Balance>ValueHere</e13:Balance>
<e13:CurrencyCode d4p1:nil="false">ValueHere</e13:CurrencyCode>
<e13:RedemptionDate>ValueHere</e13:RedemptionDate>
<e13:ExpirationDate>ValueHere</e13:ExpirationDate>
<e13:ActivationDate d4p1:nil="false">ValueHere</e13:ActivationDate>
</e13:RedemptionInfo>
<e13:ClaimInfo d4p1:nil="false">
<e13:AccountId>ValueHere</e13:AccountId>
<e13:AccountNumber d4p1:nil="false">ValueHere</e13:AccountNumber>
<e13:ClaimDate>ValueHere</e13:ClaimDate>
</e13:ClaimInfo>
</e13:Coupon>
</Coupons>
</SearchCouponsResponse>
</s:Body>
</s:Envelope>
程式碼語法
範例語法可以與 Bing 廣告 SDK搭配使用。 如需更多範例,請參閱 Bing 廣告 API 程式碼范 例。
public async Task<SearchCouponsResponse> SearchCouponsAsync(
IList<Predicate> predicates,
IList<OrderBy> ordering,
Paging pageInfo,
AccountAdditionalField? returnAdditionalFields)
{
var request = new SearchCouponsRequest
{
Predicates = predicates,
Ordering = ordering,
PageInfo = pageInfo,
ReturnAdditionalFields = returnAdditionalFields
};
return (await CustomerBillingService.CallAsync((s, r) => s.SearchCouponsAsync(r), request));
}
static SearchCouponsResponse searchCoupons(
ArrayOfPredicate predicates,
ArrayOfOrderBy ordering,
Paging pageInfo,
ArrayList<AccountAdditionalField> returnAdditionalFields) throws RemoteException, Exception
{
SearchCouponsRequest request = new SearchCouponsRequest();
request.setPredicates(predicates);
request.setOrdering(ordering);
request.setPageInfo(pageInfo);
request.setReturnAdditionalFields(returnAdditionalFields);
return CustomerBillingService.getService().searchCoupons(request);
}
static function SearchCoupons(
$predicates,
$ordering,
$pageInfo,
$returnAdditionalFields)
{
$GLOBALS['Proxy'] = $GLOBALS['CustomerBillingProxy'];
$request = new SearchCouponsRequest();
$request->Predicates = $predicates;
$request->Ordering = $ordering;
$request->PageInfo = $pageInfo;
$request->ReturnAdditionalFields = $returnAdditionalFields;
return $GLOBALS['CustomerBillingProxy']->GetService()->SearchCoupons($request);
}
response=customerbilling_service.SearchCoupons(
Predicates=Predicates,
Ordering=Ordering,
PageInfo=PageInfo,
ReturnAdditionalFields=ReturnAdditionalFields)
需求
服務: CustomerBillingService.svc v13
命名 空間: https://bingads.microsoft.com/Billing/v13