We have a requirement to send messages to group members from a custom-developed program using the Rocket.Chat REST API under a specified account.
Our specified account has the following roles:
admin
user
bot
For the admin role, all Permissions are checked except for:
Bypass rate limit for REST API
Bypass time limit
Impersonate Other Users
Initially, we tried using the REST API endpoint channels.list to find the private channel we wanted to send messages to, but we were unsuccessful.
Then we tried adding the specified account to the private channel and changing the endpoint to channels.list.joined, but we still couldnāt find the channel.
Finally, we were able to find the channel by changing the endpoint to rooms.get.
We would like to ask:
In Rocket.Chat Version: 6.8.0 Community, even if the specified account has the View Private Room permission, is it still not possible to see all private channels?
Is our approach to sending messages to private channels correct?
We have an announcement channel, but since we define channels based on the responsible business units, if all members are in the same channel, we canāt distinguish which members should be notified about specific business-related messages. Additionally, in the business unit channels where members are responsible, they can interact and discuss the messages. However, if messages are sent in the announcement channel and are visible only to the specific member, it would not be convenient for discussions with other members. If the messages are broadcast to everyone, it might raise privacy issues as irrelevant individuals would see the information.
I donāt think you can send to an existing private chat - eg DM between two users - that you are not part of.
IIRC I think I have seen this answered before and the response is āPrivacyā. I do understand why even an āadminā isnāt permitted to jump into a chat between say the CEO and CFOā¦
You would have to DM to the individual concerned.
I think Private channels are actually āgroupsā rather than āchannelsā.
Check the rocketchat url eg this is the URL for a private group:
Thank you for reminding me of the difference between channels and groups.
After rethinking our needs, we actually need to be able to send notifications to members of channels or groups.
During testing, I found that regardless of whether the View Private Room permission is enabled or disabled, channels.list can only search for public channels, groups.listAll will always search for all public and private channels.
Although private groups can be searched, if the sender account is not a member of the group,
it will return an āerror-not-allowedā error message and fail.
I also agree with the importance of privacy,
Allow members of private channels or groups to have the option to be notified,
and only join the sender account if necessary, This is actually what we need.
Likely that it is a permission for viewing via the browser, but not an API call. Have you tested this in a browser?
I am not sure that is going to be permitted for the reasons explained above.
Private means you cannot access the channel or DM unless you are allowed in somehow. I donāt think the developers are going to permit this, particularly not via the API.
You can try adding a feature-request (after having a good search through issues ) but I am not sure it will be considered.
You would probably have to run your own fork with modifications to permissions to be able to do what you require.
In the case of browsers,
whether the View Private Room permission is enabled or disabled,
it is only possible to search for public Channels or Teams.
Our current approach is that
when a user needs to receive notification messages,
we inform the user that they need to manually add the messaging account to
the corresponding channel or group and let the user to decide whether or not to do.