bhushankummar / amazon-mws

Amazon MWS NodeJS Wrapper
MIT License
197 stars 78 forks source link

There's a way to request GET_CATEGORY_LISTINGS_DATA ? #19

Closed jesusvalle closed 6 years ago

jesusvalle commented 6 years ago

Good afternoon.

There's any way to get the items by category report? I have alredy enabled this feature in my seller account contacting with amazon, and i can get this report from sellercentral, but i don't know how to request it from this tool (How to pass the category parameter, because if you don't provide one cat, you will break the amazon function). I don't found nothing about it in forums or documentation, only the query

I would be very grateful if someone could help me.

Thanks a lot for your time and this amazing tool.

bhushankummar commented 6 years ago

Can you point out me which API would you like to use from below API? http://docs.developer.amazonservices.com/en_IN/dev_guide/DG_IfNew.html

jesusvalle commented 6 years ago

Hi,

It's the reports api. I've tried sending the query GET_CATEGORY_LISTINGS_DATA via requestReport and it sends it properly (breaking my category reports function in amazon), but it seems that it needs at least one param with the parent category or something like that. I don't know exactly.

Thank you so much.

bhushankummar commented 6 years ago

@jesusvalle I did some research on this.

We have implemented all API calls which does support by Amazone MWS ScratchPad. Have you tried same API call using it?

Thank You

jesusvalle commented 6 years ago

Hi again,

Yes, let me explain it better:

I think that the api call works fine, but this specific report query probably needs an extra param to work properly (like the category id, or the category name). Otherwise, the query breaks the amazon category reports system, and i have to call amazon to make them fix it every time.

I've searched all amazon documentation, but since it's a secret function, there's nothing on internet to know how to make it work properly from the api. Now, the only way to get the category report from amazon (the most complex items report, and the only one with bullet points) it's requesting it from seller central web manually.

So, the question is: do you know how can i pass a category in GET_CATEGORY_LISTINGS_DATA report query throught a parameter with the api?

One more time, thanks a lot for your attention, and sorry for the incoveniences.

jesusvalle commented 6 years ago

For now, my call it's like this:

this.amazonMws.reports .search({ Action: 'RequestReport', MWSAuthToken: this.amzAccountData.MWSAuthToken, ReportType: 'GET_CATEGORY_LISTINGS_DATA' <-- The type which breaks amazon SellerId: this.amzAccountData.SellerId, Version: '2009-01-01' })

And as i can see, in https://mws.amazonservices.es/scratchpad/index.html there's an extra field called ReportOptions. Maybe can i pass something from there?

bhushankummar commented 6 years ago

@jesusvalle https://prnt.sc/iu94v6 Are you talking about this?

jesusvalle commented 6 years ago

Yes, it is

bhushankummar commented 6 years ago

@jesusvalle I am not sure about that as there is no documentation available for that. What I can help is you can pass an option directly to the API call just add the field name given on to the Amazon ScratchPad directly. e.g if you would like to pass extra options you can do that directly. See below.

    amazonMws.reports.search({
        'Version': '2009-01-01',
        'Action': 'GetReport',
        'SellerId': 'SELLER_ID',
        'MWSAuthToken': 'MWS_AUTH_TOKEN',
        'ReportType':'REPORT_TYPE',
        'ReportOptions':'REPORT_OPTIONS'
    }, function (error, response) {
        if (error) {
            console.log('error ', error);
            return;
        }
        console.log('response', response);
    });

For debugging purpose use this, so you can watch your request. export DEBUG=MWS:*

So if you do so then you will able to see the console as below :

  MWS:AmazonMwsResource params { host: 'mws.amazonservices.com', port: '443', path: '/Reports/2009-01-01?Version=2009-01-01&Action=GetReport&SellerId=SELLER_ID&MWSAuthToken=MWS_AUTH_TOKEN&ReportId=REPORT_ID&AWSAccessKeyId=YOUR_KEY&Timestamp=2018-03-21T11%3A48%3A03.752Z&SignatureVersion=2&SignatureMethod=HmacSHA256&Signature=C8l3zyIBxtXPnTmKNBScSVzbMt6b00mrQ4gU9KqDJpc%3D', method: 'GET', headers: { Accept: 'text/xml', 'Content-Type': 'text/xml', 'Content-MD5': 'xHMCEB8D4JpBzqm1moUIUg==' } } 

I am closing this issue as basically that is not supported by Amazon MWS itself. However, We can keep continuing the discussion here.

Thank You

jesusvalle commented 6 years ago

Yes, i know the fact about passing the same field from scratchpad in the api. But i still thinking in which format i have to pass the category to not break everything.

About the documentation, there's nothing on it, 100% confirmed.

Thank you.

bhushankummar commented 6 years ago

Do you mean that in MWS Scratchpad you getting expected response?

bhushankummar commented 6 years ago

http://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html Here is the list of different APIs available for report by category.

jesusvalle commented 6 years ago

I know them, and like i've said before, it's a secret report type not listed in amazon's documentation.

bhushankummar commented 6 years ago

hmm. I understand. In any case, let me know if you will able to make the call though ScratchPad or Library. I'll also do research on that and get back to you if I found anything.

goodryanboy commented 3 years ago

@jesusvalle Hi sir were you able to request properly the GET_CATEGORY_LISTINGS_DATA?