Skip to content

[NEW] Endpoint to anonymously read channel's messages#14714

Merged
sampaiodiego merged 7 commits intoRocketChat:developfrom
PrajvalRaval:develop
Jun 14, 2019
Merged

[NEW] Endpoint to anonymously read channel's messages#14714
sampaiodiego merged 7 commits intoRocketChat:developfrom
PrajvalRaval:develop

Conversation

@PrajvalRaval
Copy link
Copy Markdown
Contributor

Overview

This API Endpoint is made for RC Alexa and Google Action to allow Anonymous READ in VUI Devices without linking their accounts first to the Apps. This endpoint will enable access to messages in public channels, which are by definition public - and should be anonymous readable. In addition to that, this endpoint can be accessed by VUI user without any registration required. Also if admin has disabled anonymous read on his server, it won't work. So to summarise, after merging this API endpoint, we will be able to enable Alexa skill and Google Action to non-registered user if anonymous reading options are enabled on that server.

Testing

  • Enable Allow Anonymous Read inside Administration -> Accounts
  • Now you can use this to get message anonymously
curl http://localhost:3000/api/v1/channels.anonymousread?roomName=general

@rodrigok
Copy link
Copy Markdown
Member

rodrigok commented Jun 1, 2019

@PrajvalRaval thanks for your contribution, can you add tests for this new endpoint? Either for the situation where Anonymous Read is enabled and disabled?

Refer to https://github.com/RocketChat/Rocket.Chat/blob/develop/tests/end-to-end/api/01-users.js#L24 for example of how to change settings in tests.

@PrajvalRaval
Copy link
Copy Markdown
Contributor Author

@PrajvalRaval thanks for your contribution, can you add tests for this new endpoint? Either for the situation where Anonymous Read is enabled and disabled?

Refer to https://github.com/RocketChat/Rocket.Chat/blob/develop/tests/end-to-end/api/01-users.js#L24 for example of how to change settings in tests.

Hello @rodrigok, this is my first PR for Core API and I am not exactly sure what should I include in tests for endpoints. Can you please tell me what should I include in tests, perhaps with an example or something ? Thanks 👍

@PrajvalRaval
Copy link
Copy Markdown
Contributor Author

Thank You very much @MarcosSpessatto for adding tests for this endpoint. For a rookie like me, it helps a lot when senior developer like yourself come forward for our help. 👏

@PrajvalRaval
Copy link
Copy Markdown
Contributor Author

@rodrigok Just A reminder for merge. If it's alright for you. 😓

@sampaiodiego sampaiodiego changed the title [NEW] Adding Anonymous Read For Channels [NEW] Endpoint to anonymously read channel's messages Jun 14, 2019
@sampaiodiego sampaiodiego merged commit 90e1ab8 into RocketChat:develop Jun 14, 2019
@sampaiodiego sampaiodiego mentioned this pull request Jun 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants