如何修复“来自Google脚本的Amazon MWS产品详细信息API,以返回产品详细信息?”

时间:2019-04-04 17:01:10

标签: amazon-web-services return api-design amazon-mws

我正在使用Amazon MWS API,以将请求的产品数据返回到Google电子表格中。我在尝试返回产品详细信息时遇到了一些问题,并且是编码方面的新手,我不太确定API本身是什么问题。不幸的是,到目前为止,我只能获得带有时间戳的Ping响应,仅此而已。我该如何纠正以使退货信息成为产品数据?

function myFunction(){

var参数=

Action= '&Action=GetMatchingProductForId',
AwsAccessKeyID= 'AWSAccessKeyId=xxxxxx',
IdType= '&IdType=ISBN',
ListID= '&IdList.Id.1=9780321601834',
MarketplaceId= '&MarketplaceId=ATVPDKIKX0DER',
Method= 'POST\n',
ResponseGroup= '&ResponseGroup=ItemAttributes',
SellerId= '&SellerId=xxxxxx',
SecretKey= 'xxxxxx', 
Timestamp= Utilities.formatDate(new Date(), "GMT", "yyyy-MM-dd'T'HH%mm%ss'Z'"),
URL= 'https://mws.amazonservices.com',

var QueryString =

Method+'/Products/2011-10-01\n'+AwsAccessKeyID
+'&Action=GetMatchingProductForId'+IdType+MarketplaceId+ListID
+ResponseGroup+SellerId+'&SignatureMethod=HmacSHA256'
+'&SignatureVersion=2'+'&Timestamp='+Timestamp
+'&Version=2011-10-01';

 var SignedRequest = Utilities.computeHmacSha256Signature(QueryString, SecretKey)
 var Encoded = Utilities.base64Encode(SignedRequest)

var Response = UrlFetchApp.fetch(URL,{'muteHttpExceptions':true});  Logger.log(Response);

我真正想要的唯一结果是让该api在继续下一步之前返回产品数据。预先感谢您抽出宝贵时间来解决此问题。

0 个答案:

没有答案