Closed Bug 860389 Opened 11 years ago Closed 11 years ago

[login.wm.o] What API's do we want to provide?

Categories

(Webmaker Graveyard :: Login, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 863287

People

(Reporter: boozeniges, Assigned: sedge)

References

Details

(Whiteboard: [login.wm.o])

      No description provided.
Blocks: 860391
No longer blocks: 860361
Whiteboard: [login.wm.o]
Component: webmaker.org → Login
:sedge - if you can make a list of the API's that we have so far defined we can use this to see what we might be missing....
Assignee: nobody → kieran.sedgwick
POST    /user/create      - Create new Webmaker account
GET     /user/:id         - Retrieve Webmaker account info
PUT     /user/:id         - Update Webmaker account info
DELETE  /user/delete/:id  - Delete Webmaker account
POST    /user/suspend     - Suspend Webmaker account
Darn, forgot again!

:booze
:humph
Update:

POST    /user/create      - Create new Webmaker account
GET     /user/:id         - Retrieve Webmaker account info
PUT     /user/:id         - Update Webmaker account info
DELETE  /user/delete/:id  - Delete Webmaker account
POST    /user/suspend/:id - Suspend Webmaker account
You should get Wex to weigh in, but I think it's more correct to always root on user/:id like this:

DELETE  /user/:id/        - Delete Webmaker account
POST    /user/:id/suspend - Suspend Webmaker account
:wex - what you think?

This is probably hair-splitting but might it be good to switch the /user/create to be PUT and /user/:id to be POST?

PUT for brand new things and POST for updating existing records?
Flags: needinfo?(simon)
Another thing to think of - right now we have POST set up for CORS, do we also need to open GET/PUT as well?

Might be mis-understanding CORS a bit....
:booze - POST is for new entries, PUT for updates as far as I can figure. See: http://en.wikipedia.org/wiki/RESTful#RESTful_web_APIs

:humph - It looks better to me. I'll wait on :wex before making changes.
Sorry for not weighing in earlier.

As a REST API goes, this is what it should look like:

POST    /user             - Create new Webmaker account
GET     /user/:id         - Retrieve Webmaker account info
PUT     /user/:id         - Update Webmaker account info
DELETE  /user/:id         - Delete Webmaker account

In order to suspend, we'd:
PUT    /user/:id with the suspended attribute set to true
It's worth mentioning that the HTTP method *is* the verb.

C - POST
R - GET
U - PUT
D - DELETE
:wex - Is there a standard or set of best practices that I can reference in future?  Not knowing the proper useage of this stuff, and conventions for APIs, has been bugging me :/
This bug is marked as blocking bug 860391 which was due to be completed last week; are we still waiting on info from Wex, here?
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: needinfo?(simon)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.