If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

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

RESOLVED DUPLICATE of bug 863287

Status

Webmaker
Login
RESOLVED DUPLICATE of bug 863287
5 years ago
5 years ago

People

(Reporter: boozeniges, Assigned: sedge)

Tracking

Details

(Whiteboard: [login.wm.o])

Comment hidden (empty)
(Reporter)

Updated

5 years ago
Blocks: 860391
(Reporter)

Updated

5 years ago
No longer blocks: 860361
Whiteboard: [login.wm.o]

Updated

5 years ago
Component: webmaker.org → Login
(Reporter)

Comment 1

5 years ago
: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
(Assignee)

Comment 2

5 years ago
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
(Assignee)

Comment 3

5 years ago
Darn, forgot again!

:booze
:humph
(Assignee)

Comment 4

5 years ago
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
(Reporter)

Comment 6

5 years ago
: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)
(Reporter)

Comment 7

5 years ago
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....
(Assignee)

Comment 8

5 years ago
: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.

Comment 9

5 years ago
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

Comment 10

5 years ago
It's worth mentioning that the HTTP method *is* the verb.

C - POST
R - GET
U - PUT
D - DELETE
(Assignee)

Comment 11

5 years ago
: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?
(Assignee)

Updated

5 years ago
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Flags: needinfo?(simon)
Resolution: --- → DUPLICATE
Duplicate of bug: 863287
You need to log in before you can comment on or make changes to this bug.