从 Google Apps 脚本查询亚马逊 MWS

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

我正在尝试查询 Aazon MWS 以获取 ASIN 的产品价格。但我无法在 Google Apps 脚本中转换查询,因此我可以使用 UrlFetchApp。请帮助。

http://docs.developer.amazonservices.com/en_US/products/Products_GetMyPriceForASIN.html

google-apps-script amazon-mws
1个回答
0
投票

修改示例 here 以与您链接的 AWS 示例的一部分对齐:

function sendHttpPost() {


   var payload =
   {
     "ASINList.ASIN.1" : "1933890517",
     "AWSAccessKeyId" : "AKIAEXAMPLEFWR4TJ7ZQ",
     "MWSAuthToken": "amzn.mws.4ea38b7b-f563-7709-4bae-87aeaEXAMPLE"
     // and so on for all of the name value pairs that make up the query
   };

   // Because payload is a JavaScript object, it will be interpreted as
   // an HTML form. (We do not need to specify contentType; it will
   // automatically default to either 'application/x-www-form-urlencoded'
   // or 'multipart/form-data')

   var options =
   {
     "method" : "post",
     "payload" : payload
   };

   UrlFetchApp.fetch("http://example.com/upload_form.cgi", options);
 }
© www.soinside.com 2019 - 2024. All rights reserved.