Code Monkey home page Code Monkey logo

Comments (12)

masterT avatar masterT commented on June 14, 2024

ItemSearch now support all the params, including BrowseNodeId.

from amazon-product-api.

kaue avatar kaue commented on June 14, 2024

+1
@masterT What about the BrowseNodeLookup support? I need to use this operation with the ResponseGroup=NewReleases

from amazon-product-api.

kaue avatar kaue commented on June 14, 2024

@Codepoet77 @masterT I just submited a PR to support the BrowseNodeLook operation
#19

from amazon-product-api.

Codepoet77 avatar Codepoet77 commented on June 14, 2024

Hi,

Also is the awstag required? I don't see it in the documentation but I see
it in the url that is built up in util.js

I'm new to aws but I think this means that we need to be an affiliate which
I would want to avoid if possible as the docs for item search don't seem to
state it is a prerequisite.

Please let me know if I'm incorrect.

Thanks,
Andrew

from amazon-product-api.

masterT avatar masterT commented on June 14, 2024

From the AWSECommerceService doc

AssociateTag

The AssociateTag parameter is a required parameter in Product Advertising API requests. When you register as an Amazon Associate, an Associate tag is sent to you by return email. An Associate tag, also known as an Associate ID, is an automatically generated unique identifier that you will need to make requests through the Product Advertising API. When you log in to the Amazon Associates website for your locale, the page that you are directed to includes a message that says "Signed in as" followed by your Associate tag.

Once a cart is associated with an Associate Tag, you must use it in every other cart operation related to that shopping cart. Otherwise, you will receive an error.

If you do not include an Associate Tag in the CartCreate request, your request will fail.

AssociateTag is locale-specific, that is, for each locale in which you want to earn Associate revenue, you must get an Associate Tag. If you try to use a US-locale Associate Tag, for example, in the JP locale, you will not earn Associate revenue.

Be careful when specifying an AssociateTag because errors are not returned for incorrect values.

from amazon-product-api.

Codepoet77 avatar Codepoet77 commented on June 14, 2024

http://docs.aws.amazon.com/AWSECommerceService/latest/DG/BrowseNodeLookup.html

Interesting I just didnt see any mention of the AWS Tag in the sample request that is listed on this page and I actually thought that made sense because I am not trying to advertise or interact with a cart I just want to find items.

Example from this page:
http://docs.aws.amazon.com/AWSECommerceService/latest/DG/BrowseNodeLookup.html

http://webservices.amazon.com/onca/xml?
Service=AWSECommerceService&
AWSAccessKeyId=[AWS Access Key ID]&
Operation=BrowseNodeLookup&
BrowseNodeId=163357
&Timestamp=[YYYY-MM-DDThh:mm:ssZ]
&Signature=[Request Signature]

Have you ever attempted to make the call without the awstag for the 3 methods that are currently supported. The documentation that you are referencing appears to be accurate for the cart method.

http://docs.aws.amazon.com/AWSECommerceService/latest/DG/CartCreate.html

AssociateTag is documented as required field for this particular call.

According to the documentation this is not necessarily true for BrowseNodeLookup, ItemSearch and ItemLookUp. It is not listed as a required field

http://docs.aws.amazon.com/AWSECommerceService/latest/DG/ItemSearch.html

http://docs.aws.amazon.com/AWSECommerceService/latest/DG/BrowseNodeLookup.html

http://docs.aws.amazon.com/AWSECommerceService/latest/DG/ItemLookup.html

Please let me know what you find. Would be nice to only have to supply the required fields for all 3 calls and also have the ability to supply the optional fields listed in the docs.

from amazon-product-api.

Codepoet77 avatar Codepoet77 commented on June 14, 2024

You can ignore my last question. Through trial and error and I was able to successfully make the ItemSearch call. I did have to use the awstag as you had suggested. At this point I just need access to the recent changes for BrowseNodeLookup and use of BrowseNodeId in ItemSearch.

Im new to Node.js and Express was trying to pull them down via npm using the "npm update --save" command in Expressjs app. I am assuming they are not yet available.

Thanks again for your help.

from amazon-product-api.

masterT avatar masterT commented on June 14, 2024

The PR #19 is not merge in master branch of the projet yet. When it will be merged you will be able to npm update --save. But for the moment you can use the version in the branch of @kauegimenes but you will need to uninstall the other one. So npm uninstall amazon-product-api and then npm install kauegimenes/amazon-product-api

from amazon-product-api.

masterT avatar masterT commented on June 14, 2024

@Codepoet77 did you set the awsTag to an empty string or you removed it from the request params?

from amazon-product-api.

masterT avatar masterT commented on June 14, 2024

@Codepoet77 @kauegimenes PR #19 is merged and published.

from amazon-product-api.

Codepoet77 avatar Codepoet77 commented on June 14, 2024

@masterT

Thanks for the npm tips as I am new to github and the npm world. :)

I tried removing the awsTag from the request params. Please try it yourself though because I tested it out quickly. I initially set it to an empty string before realizing that I needed to also remove it from the URL that is being built up. So I did both but would be good to have you confirm it as well. I still find it odd that the docs explicitly state it as being required for the cartCreate but not for the itemLookup, itemSearch and browseNodeLookup.

Thanks again!

from amazon-product-api.

masterT avatar masterT commented on June 14, 2024

@Codepoet77 I would have opened another issue for this, because it is not related to this issue, but I tried it and it didn't work.

First it change generateQueryString to add the AssociateTag only when it's defined.

if (typeof credentials.awsTag != "undefined") {
   params['AssociateTag'] = credentials.awsTag;
}

Without AssociateTag

var client = amazon.createClient({  
  awsId: process.env.AWS_ID,
  awsSecret: process.env.AWS_SECRET
});

client.itemSearch({
  keywords: 'Pulp fiction',
  searchIndex: 'DVD',
  responseGroup: 'ItemAttributes,Offers,Images',
  itemPage: '3'
}, function(err, results) {
  if (err) {
    console.log("ERROR");
    console.log(err);
  } else {
    console.log("SUCCESS");
    console.log(results);
  }
});

// result in the console
// => Success
// undefined

With blank AssociateTag

var client = amazon.createClient({
  awsTag: '',
  awsId: process.env.AWS_ID,
  awsSecret: process.env.AWS_SECRET
});

client.itemSearch({
  keywords: 'Pulp fiction',
  searchIndex: 'DVD',
  responseGroup: 'ItemAttributes,Offers,Images',
  itemPage: '3'
}, function(err, results) {
  if (err) {
    console.log("=> Error");
    console.log(err);
  } else {
    console.log("=> Success");
    console.log(results);
  }
});


// result in the console
// => Success
// undefined

I will close this issue. If there is anything else open a new issue. 😎

from amazon-product-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.