簡體   English   中英

產品廣告API無效

[英]Product advertising API not working

我剛加入亞馬遜產品廣告API的副項目。 我能夠在暫存器中運行查詢,但在編碼時它給出了錯誤。 如果我出錯了,請給我任何建議。 我正在使用Node.JS。

const OperationHelper = require('apac').OperationHelper;

const opHelper = new OperationHelper({
    awsId:     '',
    awsSecret: '',
    assocId:   'tarun123-21'
});

opHelper.execute('ItemSearch', {
  'SearchIndex': 'Books',
  'Keywords': 'harry potter',
  'ResponseGroup': 'ItemAttributes,Offers',
   'Service' : 'AWSECommerceService'

}).then((response) => {
    console.log("Results object: ", response.result);
    console.log("Raw response body: ", response.responseBody);
}).catch((err) => {
    console.error("Something went wrong! ", err);
});

它給出以下錯誤:

Results object:  { ItemSearchErrorResponse:
   { '$': { xmlns: 'http://ecs.amazonaws.com/doc/2013-08-01/' },
     Error:
      { Code: 'AWS.InvalidAssociate',
        Message: 'Your AKIAI7SZEKEZNMFWGJDQ is not registered as an Amazon Assoc
iate. Please register as an associate at https://affiliate-program.amazon.com/gp
/associates/join/landing/main.html.' },
     RequestId: 'e860887e-4bf7-4076-bfa9-6d2212324ba4' } }
Raw response body:  <?xml version="1.0"?>
<ItemSearchErrorResponse xmlns="http://ecs.amazonaws.com/doc/2013-08-01/"><Error
><Code>AWS.InvalidAssociate</Code><Message>Your AKIAI7SZEKEZNMFWGJDQ is not regi
stered as an Amazon Associate. Please register as an associate at https://affili
ate-program.amazon.com/gp/associates/join/landing/main.html.</Message></Error><R
equestId>e860887e-4bf7-4076-bfa9-6d2212324ba4</RequestId></ItemSearchErrorRespon
se>

由於錯誤建議您需要Amazon Associate帳戶才能訪問API。 您使用的憑據似乎無效。 您可以在此處測試您的憑據Amazon Scratch pad

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM