未获取产品广告 Api AWS 的促销摘要

问题描述 投票:0回答:1

我想在我的网站上显示来自 AWS 的优惠券、优惠和交易
例如

我在 Amazon Docs 中尝试过的内容我在 Php[Codeigniter] 中工作,它也无法在 AWS 的暂存器上工作

http://webservices.amazon.in/onca/xml?
Service=AWSECommerceService&
AWSAccessKeyId=[AWS Access Key ID]&
AssociateTag=[Associate ID]&
Operation=ItemLookup&
ItemId=B000AQSMPO&
IdType=ASIN&
ResponseGroup=Offers,PromotionSummary&
Version=2013-08-01
&Timestamp=[YYYY-MM-DDThh:mm:ssZ]
&Signature=[Request Signature]

我想从这个休息服务中得到什么

<Promotions>
  <Promotion>
  <Summary>
    <PromotionId>A2QIQTNOFYRK5N</PromotionId>
    <Category>BuyAmountXGetAmountOffX</Category>
    <EligibilityRequirementDescription>Save $25.00 when you spend $125.00 or more on Kitchen & Housewares or Bed & Bath products offered by Amazon.com. Enter code AUGSAVER at checkout.</EligibilityRequirementDescription>
    <BenefitDescription>Save $25.00 when you spend $125.00 or more on Kitchen & Housewares or Bed & Bath products offered by Amazon.com. Enter code AUGSAVER at checkout.</BenefitDescription>
    <TermsAndConditions>.......</TermsAndConditions>
    </Summary>
  </Promotion>
</Promotions>

除了促销摘要之外,我得到了所有内容

我正在使用 PHP CUrl 来获取响应

$request_url = 'http://'.$endpoint.$uri.'?'.$canonical_query_string.'&Signature='.rawurlencode($signature);

 //return $request_url;

  //  I prefer using CURL 
 $ch = curl_init();
 curl_setopt($ch, CURLOPT_URL,$request_url);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 curl_setopt($ch, CURLOPT_TIMEOUT, 15);
 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
 $xml_response = curl_exec($ch);
php codeigniter amazon-web-services amazon-product-api
1个回答
0
投票

当我尝试获得产品促销时,我遇到了同样的问题。困扰了我两天后,我的脑海中闪现出一个想法:产品促销信息不显示,可能是因为它没有任何促销活动。 然后我检查了亚马逊同事下的亚马逊促销代码。我点击了“当前促销代码”下面的链接,并在亚马逊产品页面上获得了 ASIN:“B00LV5NY3I”。

所以,我在 scratchpad 下运行这个任务:

https://webservices.amazon.com/onca/xml?
AWSAccessKeyId=[Your Access Key]&
AssociateTag=[Your Associate Tag]&
IdType=ASIN&
ItemId=B00LV5NY3I&
Operation=ItemLookup&
ResponseGroup=Offers,PromotionSummary&
Service=AWSECommerceService&
Timestamp=[YYYY-MM-DDThh:mm:ssZ]&
Signature=[Request Signature]

然后,我在回复中得到了PromotionSummary:

<Promotions>
<Promotion>
<Summary>
<PromotionId>ATVP6WYIMZVUO</PromotionId>
<Category>BuyQuantityXGetPercentOffX</Category>
<EligibilityRequirementDescription>
Save 15% with this coupon. Enter code 4FCECM15 at checkout.
</EligibilityRequirementDescription>
<BenefitDescription>
Save 15% with this coupon. Enter code 4FCECM15 at checkout.
</BenefitDescription>
<TermsAndConditions>
<strong>To receive the Best Value discount:</strong> <ol><li>Add all products described in the promotion to your Shopping Cart in one of two ways:</li> <ul><li>Via the “Add both to Cart” button in the promotion description, OR</li> <li>Via the “Add to Shopping Cart” button on each respective product information page.</li> </ul> <li>The amount of the Best Value discount will be reflected on the final order checkout page and will be allocated proportionally to all promotion items in the Shopping Cart, including the Best Value item itself. For example, if the promotion offers $5 off one item worth $10 when you purchase two qualifying items worth $20 each, the $5 will be divided proportionately between the three items, so that the Best Value item will appear with a $1 discount, and each of the two other qualifying items will appear with a $2 discount.</li> </ol><strong>Terms and Conditions:</strong> <ul> <li>The promotion is valid for a limited time only. Amazon reserves the right to cancel it at any time.</li> <li>If you do not purchase the qualifying and Best Value items added to your Shopping Cart when the promotion is in effect, the discount will not apply.</li> <li>The promotion applies only to qualifying items displaying the offer message on their product information pages.</li> <li>The promotion applies only to products sold by the seller indicated in the offer message. It does not apply to the same products sold by other sellers. For example, if the promotion applies to cookware offered by Amazon.com, the same cookware offered by other sellers on the Amazon.com website (e.g. Macy’s, etc.) do not qualify.</li> <li>Unless the promotion indicates otherwise, it applies to the lowest priced qualifying item and may not be combined with other offers.</li> <li>All qualifying and Best Value items must be purchased in one order and shipped to a single address.</li> <li>If you return any of the promotion items, we will subtract your Best Value discount from your return credit.</li> <li>Shipping and handling charges apply to all products, including Best Value items.</li> <li>Add-on Items require a minimum purchase. See amazon.com/addon for details.</li> <li>This promotion may not be combined with other offers, including promotional certificates.</li> <li>Does not apply to orders placed with 1-Click.</li> <li>Offer good while supplies last.</li> <li>Void where prohibited.</li> <li>If you remove any of the promotion items from your Shopping Cart or violate any of the Terms and Conditions, the promotion will be invalid, and the discount will not apply.</li> </ul>
</TermsAndConditions>
</Summary>
</Promotion>
...
</Promotions>

已确认:如果您的促销请求遵循编程指南,但响应中不包含任何促销信息,那是因为返回的优惠没有任何促销信息,您需要尝试其他关键字,ItemId、SearchIndex、BrowseNode 或下一页(每个请求仅返回 10 项)。

© www.soinside.com 2019 - 2024. All rights reserved.