t3chnoboy / amazon-product-api

:credit_card: Amazon Product Advertising API client
366 stars 104 forks source link

The AWS Access Key Id you provided does not exist in our records. #85

Open Albert2522 opened 7 years ago

Albert2522 commented 7 years ago

Hi I checked my keys on a scratchpad but I still get this error whether it itemSearch or ItemLookUp

{ '$': { xmlns: 'http://ecs.amazonaws.com/doc/2013-08-01/' }, Error: [ { Code: [ 'InvalidClientTokenId' ], Message: [ 'The AWS Access Key Id you provided does not exist in our records.' ] } ], RequestId: [ 'ad5243d3-04b2-4bd7-8908-82789ed48233' ] }

Code:

const amazon_client = amazon.createClient({ awsID: 'smthg', awsSecret: 'smthg', awsTag: 'smthg' });

amazon_client.itemLookup({ idType: 'UPC', itemId: '884392579524' }).then(function(results) { console.log(JSON.stringify(results)); }).catch(function(err) { console.log(util.inspect(err, false, null)); });

nick-preda commented 7 years ago

where do you actually try to get the keys from?

there are so many from where to choose from

budda commented 7 years ago

Make sure you have specified the domain endpoint to match where your access key is registered for. e.g.

domain: 'webservices.amazon.co.uk'

AnthoniG commented 7 years ago

@budda Hi, just about to start using the library for a project I have an idea for.

I want to offer the ability to search multiple Amazon 'areas' Does this mean I will have to register with Amazon for each of those countries ? (ie like .ca, .za, etc) ?

budda commented 7 years ago

@AnthoniG yeah your credentials (key) needs to be registered for the country you want to search in, otherwise you'll get an API error.

AnthoniG commented 7 years ago

@budda Thanks for that. Guess looks like got some more registration forms to fill out then. One for each country I want to search in (which is a few lol)

Can I use the same account I used before? I registered .co.uk (because that is where I am based), so can I use that same one to register for .ca, .it, .za, etc ?