Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement complete set of HTTP methods #6

Open
Bravo555 opened this issue Mar 8, 2018 · 3 comments
Open

Implement complete set of HTTP methods #6

Bravo555 opened this issue Mar 8, 2018 · 3 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Milestone

Comments

@Bravo555
Copy link
Member

Bravo555 commented Mar 8, 2018

As seen on wikipedia page about REST, there are some fancy HTTP methods we're not using. Implementing them would decrease the quantity of needed endpoints and make API more convenient and natural to use.

@Bravo555 Bravo555 added the enhancement New feature or request label Mar 8, 2018
@Bravo555 Bravo555 added this to the Version 1.0 milestone Mar 8, 2018
@Bravo555 Bravo555 added help wanted Extra attention is needed question Further information is requested labels Mar 26, 2018
@Bravo555
Copy link
Member Author

Bravo555 commented Mar 26, 2018

Before actually implementing, it would be nice to have complete list of needed changes.
Summoning @JJendryka

  • /accept_with_token/:id/:token and /reject_with_token/:id/:token are rather verbose. They could be replaced with PATCH and DELETE to /quotes/:id.
  • Since /daily, as @JJendryka said, makes a new entry in a daily collection (that's why it's POST), it would be nice to actually have this collection accessible (make /dailies) and submit new daily via /dailies/new.

@Bravo555
Copy link
Member Author

@Bravo555 Bravo555 self-assigned this Apr 26, 2018
@Bravo555
Copy link
Member Author

Bravo555 commented Apr 26, 2018

🔒 - With token authorization

/quotes

  • /quotes (only accepted quotes)
  • /quotes/:id
    • GET Get the quote.
    • PATCH Accept the quote or change its text, annotation, date. 🔒
    • DELETE Delete the quote (or reject it). 🔒
  • /random -> /quotes/random
    • GET - Get random quote.
  • /daily -> /quotes/daily
    • GET Get today's quote.
    • POST Make a new daily. 🔒
  • /submissions -> /quotes/submissions
    /quote/submissions is a view of quote which shows submitted and not yet accepted quotes. All endpoints of /quotes apply here.
  • /submissions - only not accepted quotes are here.
  • /submit -> POST /quotes
  • /accept -> PATCH /quotes/:id

As accept|reject_with_token endpoints are now used by email notification system, they should not be removed until we make email system use them.

All updated endpoints in 1.0.0 will be prepended with /v1 in the URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant