Hey. I'm a little confused, hopefully I'm just missing something. Here is what I've got in an attempt to get historicals for the user.
// Auth into Robinhood
router.get('/auth', ensureAuthenticated, function(req, res){
(async () => {
try {
let loginResult = await robinhood.login({ username:req.user.robinhood_user, password:req.user.robinhood_password });
let account = await robinhood.getUserData();
var opts = {
account_number:account.id,
interval:"day"
};
let historicals = await robinhood.getHistoricals(opts);
res.json(historicals);
} catch(e) {
console.log(e);
}
})();
});
and the error I'm getting says simply that
{ Error: API Response Error. | <h1>Not Found</h1><p>The requested URL /portfolios/historicals/<my account id>/ was not found on this server.</p>
at RobinHood.request (C:\Users\Dylan\Documents\hunch2.0\node_modules\robinhood-api\index.js:144:18)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:169:7)
additionalInfo: '<h1>Not Found</h1><p>The requested URL /portfolios/historicals/<my account id>/ was
not found on this server.</p>',
code: 'E_API_ERROR' }
Is there another account number I should be using or is the API broken? What's up?
Thanks in advance for taking a look.
Hey. I'm a little confused, hopefully I'm just missing something. Here is what I've got in an attempt to get historicals for the user.
and the error I'm getting says simply that
Is there another account number I should be using or is the API broken? What's up?
Thanks in advance for taking a look.