rocketchat-node icon indicating copy to clipboard operation
rocketchat-node copied to clipboard

rocketChatClient.channels.history bad request

Open starhound opened this issue 4 years ago • 0 comments

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. (/home/wesley/rocketchat-ddp-listener/node_modules/request/request.js:1044:10) at Request.emit (events.js:198:13) at IncomingMessage. (/home/wesley/rocketchat-ddp-listener/node_modules/request/request.js:965:12) at IncomingMessage.emit (events.js:203:15) at endReadableNT (_stream_readable.js:1145:12) at process._tickCallback (internal/process/next_tick.js:63:19) name: 'RequestError', statusCode: 400 }

Placing the channel.history call outside of the login function callback gives me a not authenticated error as well.

starhound avatar Jun 03 '20 18:06 starhound