bhushankummar / amazon-mws

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

Get the listing product with Report #80

Closed foch01 closed 5 years ago

foch01 commented 5 years ago

Hello,

I can not retrieve a report of all products from a sellercentral account with this method:

    var ReportRequestId = '10101010XXX';
    amazonMws.reports.search({
        'Version': '2009-01-01',
        'Action': 'GetReportRequestList',
        'SellerId': 'SELLER_ID',
        'MWSAuthToken': 'MWS_AUTH_TOKEN',
        'ReportRequestIdList.Id.1': ReportRequestId
    }, function (error, response) {
        if (error) {
            console.log('error ', error);
            return;
        }
        console.log('response', response);
    });  

It returns to me this:

"HasNext": "false",
         "ReportRequestInfo": {
             "ReportType": "_GET_MERCHANT_LISTINGS_ALL_DATA_",
                 "ReportProcessingStatus": "_SUBMITTED_",
                 "EndDate": "2019-03-26T09:16:33+00:00",
                 "Scheduled": "false",
                 "ReportRequestId": "64163017981",
                 "SubmittedDate": "2019-03-26T09:16:33+00:00",
                 "StartDate": "2019-03-26T09:16:33+00:00"
             },
     "ResponseMetadata": {
             "RequestId": "d2cab60e-30a5-47d1-8555-248c313bb0a6"
             },
     "Headers": {...},
"StatusCode": 200
}

I do not have the ReportId in the request response

That should have returned to me this:

<GetReportListResponse xmlns="http://mws.amazonaws.com/doc/2009-01-01/">
  <GetReportListResult>
    <HasNext>false</HasNext>
    <ReportInfo>
      <ReportType>_GET_MERCHANT_LISTINGS_ALL_DATA_</ReportType>
      <Acknowledged>false</Acknowledged>
      <ReportId>15521486795017981</ReportId>
      <ReportRequestId>64163017981</ReportRequestId>
      <AvailableDate>2019-03-26T09:16:44+00:00</AvailableDate>
    </ReportInfo>
  </GetReportListResult>
  <ResponseMetadata>
    <RequestId>03e99980-121c-4df9-a69c-58eb4c606094</RequestId>
  </ResponseMetadata>
</GetReportListResponse>
foch01 commented 5 years ago

Up ?

bhushankummar commented 5 years ago

@foch01

76 Added feature to allow a user to change response type into XML format.

foch01 commented 5 years ago

It can not be done in JSON format?

bhushankummar commented 5 years ago

It can be in both XML as well as JSON.

bhushankummar commented 5 years ago

@foch01 The new version has been released with a fixed and new feature. https://github.com/bhushankumarl/amazon-mws/releases/tag/v0.0.24

foch01 commented 5 years ago

Yes I understand but I want to do this : https://help.godatafeed.com/hc/en-us/articles/360000192092-Amazon-Get-product-catalog-using-Amazon-MWS-Scratchpad

And it is impossible to recover the report id in my answer.

Whereas with the scratchpad it works well

foch01 commented 5 years ago

It's not possible to get this response correctly in JSON ?

bhushankummar commented 5 years ago

@foch01 You have to wait until the submitted report has been processed. Then after you can have the reportId.

Reference : http://docs.developer.amazonservices.com/en_IN/reports/Reports_Overview.html

foch01 commented 5 years ago

I have to wait how long?

Because when I do exactly the same manipulation on the scratchpad it's immediate

bhushankummar commented 5 years ago

@foch01 Correct.

foch01 commented 5 years ago

I have to wait how long?