rocketchat-node
rocketchat-node copied to clipboard
rocketChatClient.channels.history bad request
rocketChatClient.authentication.login('username', 'password', function(err, body) { if(err) console.log(err); else console.log(body); //BAD REQUEST rocketChatClient.channels.history('roomIdNumber', {}, function(err, body) { if(err) console.log(err); else console.log(body); }); });
Maybe I'm doing this wrong? Login returns ok result, the following call gives:
{ RequestError: The parameter "roomId" or "roomName" is required [error-roomid-param-not-provided]
at Request.clientRequest [as _callback] (/home/wesley/rocketchat-ddp-listener/node_modules/rocketchat/lib/net.js:146:38)
at Request.self.callback (/home/wesley/rocketchat-ddp-listener/node_modules/request/request.js:187:22)
at Request.emit (events.js:198:13)
at Request.
Placing the channel.history call outside of the login function callback gives me a not authenticated error as well.