Skip to content

User Historicals #1

Description

@mxchinegod

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions