Is there a way to get messages from a group channel with access code without join?


I’m trying to implement read-only (or preview) mode, which shows messages from a specific group channel which needs access code before/without join. Is there a way to do this?
(I saw this from the community, I’d like to do something similar - Private Channel Preview UI Component - reading Tyler’s comment, it seems there is a way to achieve, but I can’t find any)

I tried this:

        const listQuery = groupChannel.createPreviousMessageListQuery();
        listQuery.load(100, false, "", (messages, error) => {
          if (error) {
            console.error("Load error", error);

          console.log("Load previous messages", messages);

but it returns Uncaught (in promise) SendBirdException: Not a member. exception only.
API call returns:

message: “Not authorized. “Channel has access code”.”,
code: 400108,
error: true


Hi @Eueddem_Kim,

Welcome to the Sendbird Community. In order to retrieve the messages of a channel that a user is not a part of, you would need to utilize the Platform API. Since this means exposing your API Token, we typically recommend creating wrapper functions that make a call to your own backend to obtain the messages. This would allow you to hide your Api-Token and ensure its not compromised.