RocketChat / RocketChat/Rocket.Chat
Feature Request: Support for user_id parameter in the subscriptions.getOne API endpoint
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
It would be ideal for the subscriptions.getOne endpoint to support a user_id parameter. Right now it is not possible to obtain a user's room preferences via the API with a privileged user account, just with an auth token that is generated by the user you would like to obtain the preferences from.
In our use case we would like to obtain a user's notification preferences for a room and then let our website - that includes a Rocket.Chat iFrame - handle the custom web push notifications based on the notification preferences set by the user in Rocket.Chat. Of course you can directly access the MongoDB database, and this is what we currently do, but having an API endpoint for this would be the better way to handle this, especially since the endpoint basically already exists.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the subscriptions.getOne API endpoint and its API reference to locate the existing implementation and related tests. Add support for a privileged caller to provide user_id, then verify that the endpoint returns the specified user's room notification preferences without requiring that user's auth token.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100