0

I'm trying to download report document from amazon SP API but couldn't figure out what should I do. Did everything they said in these link1 link2 link3 links and got same error from all these three.

error:

Error: incorrect header check
    at Zlib.zlibOnError [as onerror] (node:zlib:189:17) {
  errno: -3,
  code: 'Z_DATA_ERROR'
}

Last tried code:

const res = await axios.get(
      'mylink'
);

const payload = Buffer.from(res.data, 'base64');

const data = JSON.parse(pako.inflate(payload, { to: 'string' }));
console.log('first', data);
Mj Ebrahimzadeh
  • 587
  • 9
  • 22

1 Answers1

0

When running the report API, a payload will be received containing the report ID. Simply take the latest report ID and use the "getReportDocument" method to retrieve the report URI. The URI will be encrypted with GZIP, but the report can still be downloaded by clicking the URI or by removing the GZIP and saving it.