Get poll by share token through REST-API
A pull request for this has already been merged.
- #4657 by @dartcafe — merged
- Dominant language
- JavaScript
- Stars
- 284
- Forks
- 91
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 50
Description
⚠️ This issue respects the following points: ⚠️
- I agree to follow Nextcloud's Code of Conduct.
Describe the goal you'd like to achieve
As a user of the REST-API, I would like to be able to get a poll using only a share token.
Currently, it is only possible to access a poll by PollId when using REST-API. When someone gets a public share, they can use the share/{token} endpoint to get the PollId but this doesn't give them the authorization of accessing the poll.
Describe possible solutions
I see two possible implementations :
- Automatically mark the user as involved with a poll when they use the
share/{token}endpoint so that they can simply GETpoll/{pollId}(or create a dedicated endpoint to get involved with a poll using the share token). - Create a new endpoint like
GET /api/v1.0/poll/{token}which would return a poll.
I would recommend against the second option as it would require more work to create endpoints to let the user access the list of options and to vote to make it entirely functional.
Additional context
No response
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 by reviewing linked pull request #4657 and the existing REST entry points for share/{token} and poll/{pollId}. Confirm the intended authorization flow and whether the share token can support retrieving the poll, its options, and voting; done means the complete token-based REST workflow is functional.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100