Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

[API]How can i get the all messages to the particular channel ?

Open sachinrkeche opened this issue 8 years ago • 4 comments

Hello Developers, I am fetching this API https://ctsichat.mvoipctsi.com/api/v1/channels.history GET request require parameter are X-Auth-Token="", X-User-Id="" and roomId="" I tried this one to fetch the history of the single channel but I didn't get the expected result, in their mismatch is the documentation or I am doing something wrong? please help me out.

sachinrkeche avatar Dec 27 '17 06:12 sachinrkeche

Best place to look is our documentation and then the source code.

https://rocket.chat/docs/developer-guides/rest-api/channels/history/

https://github.com/RocketChat/Rocket.Chat/blob/develop/packages/rocketchat-api/server/v1/channels.js#L458

graywolf336 avatar Jan 03 '18 20:01 graywolf336

Thank you so much i got it @graywolf336 .

sachinrkeche avatar Jan 04 '18 10:01 sachinrkeche

👍

graywolf336 avatar Jan 07 '18 02:01 graywolf336

I am getting the message list from "groups.history" but this API doesn't return the all messages I am trying for this one "channels.history" but this API doesn't work with the same parameter that i have been passed for "group.history" the user id which i am sending is itself of member of that channel but, still i am getting this error when i fire this ["channels.history"]API from Postman,

{ "success": false, "error": "The parameter "roomId" or "roomName" is required [error-roomid-param-not-provided]", "errorType": "error-roomid-param-not-provided" }

even those i am sending X-Auth-Token, X-User-Id & roomId

sachinrkeche avatar Jan 07 '18 11:01 sachinrkeche