openzim / nautilus-webui

SaaS Web UI for nautilus
GNU General Public License v3.0
1 stars 0 forks source link

The Design of APIs #14

Closed FledgeXu closed 6 months ago

FledgeXu commented 1 year ago

The purpose of this issue is to track the discussions about the design of backend apis.

Users

POST /user
Create a new user.
DELETE /user
Delete a user.

Collections:

GET /user/collection
GET all collections of a users.
GET /user/collection/id:int
GET a collection by its id.
DELETE /user/collection/id:int
Delete a collection by its id.
PUT /user/collection/id:int
Update a collection's info by its id.

Files:

GET /user/collection/id:int/file
Get all files' info of a collection.
POST /user/collection/id:int/file
Upload file(s).
PUT /user/collection/id:int/file/id:int
Update the metadate of a file.
DELETE /user/collection/id:int/file/id:int
Deletate the file.

Metadata:

GET /user/collection/id:int/metadata
GET the metadata of a collection
PUT /user/collection/id:int/metadata
Update the the metadata.

Archive:

GET /user/collection/id:int/archive
GET all archives info.
POST /user/collection/id:int/archive
Create a archive.
rgaudin commented 1 year ago

Rest convention is to use plural form so /user would be /users

Rest is OK ; albeit the changes in the DB (#15) that should probably reflect here (no concept of metadata but an Archive request instead)