question

darianbjohnson avatar image
darianbjohnson asked

Dash Replenishment API calls - connection errors

I am getting the weirdest error when attempting to call a DRS API -

Error: write EPROTO 101057795:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:794

I'm using node.js.. here's a peek at the code:

const https = require('https'); 
var options = { 
  hostname: 'dash-replenishment-service-na.amazon.com', 
  port: 443, 
  path: '/subscriptionInfo', 
  method: 'GET', 
  headers: {'Authorization' : 'Bearer (' + item.Access_Token + ')', 
    'x-amzn-accept-type': 'com.amazon.dash.replenishment.DrsReplenishResult@1.0', 
    'x-amzn-type-version': 'com.amazon.dash.replenishment.DrsReplenishInput@1.0'} 
}; 
var req = https.request(options, (res) => {
  console.log('statusCode:', res.statusCode); 
  console.log('headers:', res.headers); 
  res.on('data', (d) => {
  process.stdout.write(d); 
}); 
}); 
req.on('error', (e) => {
  console.log("we have a error");
  console.error(e); 
}); 
req.end();
dash replenishment service
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

darianbjohnson avatar image
darianbjohnson answered

User error... I had the wrong version type

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.