产品广告API无效

我刚刚join亚马逊产品广告api副学士课程。 我能够在暂存器中运行查询,但在编码时它给出了错误。 请给我任何build议,如果我错了。 我正在使用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。 您使用的凭据似乎无效。 你可以在这里testing你的凭证Amazon Scratch Pad