Amazon MWS客户端库c# AWS Access Key Id错误

本文关键字:Access Key Id 错误 AWS MWS 客户端 Amazon | 更新日期: 2023-09-27 17:50:39

我正在使用Amazon c#客户端库获取产品信息,并不断得到错误"您提供的AWS Access Key Id在我们的记录中不存在"。(是的,我试过卖家论坛,但没有得到答案)。当我使用他们的刮擦板使用相同的访问键时,我得到了正确的响应。我确实看到了这篇文章(获取'您提供的AWS访问密钥Id在我们的记录中不存在'错误与亚马逊MWS),并试图交换参数,但没有工作。这是我的c#代码。如有任何帮助,不胜感激

string AccessKey = "xxx";
            string SecretKey = "xxx";
            string AppName = "ProductFunctionsApp";
            string AppVersion = "1.0";
            string ServiceURL = "https://mws.amazonservices.com/Products/2011-10-01";
            string SellerId="xxxx";
            string MarketPlaceId = "xxx";//US
            //right now MWSAuthToken is only if a developer is using a sellers account
              MarketplaceWebServiceProductsConfig config = new MarketplaceWebServiceProductsConfig();
             config.ServiceURL = ServiceURL;
             config.SignatureMethod = "HmacSHA256";
             config.SignatureVersion = "2";
 MarketplaceWebServiceProductsClient client = new MarketplaceWebServiceProductsClient(AppName, AccessKey, SecretKey, AppVersion, config);
  ASINListType type = new ASINListType();
            List<string> ASINList = new List<string>();
            ASINList.Add("B001E6C08E");
            type.ASIN = ASINList;
           ;
          GetCompetitivePricingForASINRequest request = new GetCompetitivePricingForASINRequest();
            request.SellerId = SellerId;
            request.ASINList = type;
            request.MarketplaceId = MarketPlaceId;
  GetCompetitivePricingForASINResponse response = client.GetCompetitivePricingForASIN(request);

Amazon MWS客户端库c# AWS Access Key Id错误

他们的一些API客户端有不同顺序定义的类初始化参数

所以如果你复制并粘贴初始化代码,你将最终发送应用程序名称而不是访问键。

        var service = new MarketplaceWebServiceProductsClient(
            applicationName, applicationVersion, accessKeyId, secretAccessKey, config);

这里就不一样了:

        var service = new FBAInventoryServiceMWSClient(
            accessKeyId, secretAccessKey, applicationName, applicationVersion, config);

仔细检查一下。