From 449c20fac2c21fa8e3a6e1998aa610934dfe1240 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Mon, 11 Oct 2021 17:39:20 +0200 Subject: [PATCH] Added API specification file --- API.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 API.md diff --git a/API.md b/API.md new file mode 100644 index 0000000..8eb4081 --- /dev/null +++ b/API.md @@ -0,0 +1,41 @@ +# API Design + +This file describes the API that the software adheres to. All routes are defined under a shared `api` namespace. + +`(A)` means the route can only be accessed by an admin user. + +## v1 + +## Authentification + +* POST `/auth/login` - generate new JWT & refresh token pair given user credentials +* POST `/auth/refresh` - generate new JWT & refresh token pair given valid refresh token + +## Posts + +* GET `/posts?&` - get list of posts from the default feed given offset & limit +* GET `/posts?&&` - get list of posts of a specific section +* (A) POST `/posts` - create a new post +* GET `/posts/` - get a specific post +* (A) DELETE `/posts/` - delete a post +* (A) PATCH `/posts/` - patch a post + +## Sections + +* GET `/sections?&` - get list of sections +* GET `/sections/` - get specific section +* (A) POST `/sections` - create a new section +* (A) PATCH `/sections/` - patch a section +* (A) DELETE `/sections/` - delete a section (what happens with posts?) + +## Users + +* (A) GET `/users?&` +* (A) POST `/users` +* (A) GET `/users/` +* (A) PATCH `/users/` +* (A) DELETE `/users/` + +## Feeds + +WIP