diff --git a/README.md b/README.md index 7803c70b6690168a7e16bf4495b8fdb0d8c2e6e7..ba29a56131eee74e678578d0a01c88a4f5f98bca 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ facilitates effective collaboration. * [Mockups](docs/mockups.md) * [Accessibility Report](docs/accessibility.md) * [User Documentation](docs/user-docs.md) -* [API Documentation](docs/user-docs.md) +* [API Documentation](docs/api-docs.md) ## Getting Started diff --git a/docs/api-docs.md b/docs/api-docs.md index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..523d32272a61814a1bda0f04d55b6f01e5a67839 100644 --- a/docs/api-docs.md +++ b/docs/api-docs.md @@ -0,0 +1,13 @@ +# API v1 documentation + +This document lists and describes all of the api paths in the current version of the backend api +implementation. The documentation is split into multiple different files: + +* [Authentication](api/authentication.md) +* [Users](api/users.md) +* [Teams](api/teams.md) +* [Projects](api/projects.md) +* [Tasks](api/tasks.md) +* [Comments](api/comments.md) +* [Work](api/work.md) + diff --git a/docs/api/authentication.md b/docs/api/authentication.md new file mode 100644 index 0000000000000000000000000000000000000000..9f3b7694245fd771aaf284738b223ef2e5ec3253 --- /dev/null +++ b/docs/api/authentication.md @@ -0,0 +1,87 @@ +## Authentication + +### POST `/auth/register` + +Register a new user account with the given username and password. Optionally a email and real name +can also be supplied. + +#### Request body + +```typescript +interface Body { + username: string; + password: string; + email?: string; + realname?: string; +} +``` + +#### Response body + +```typescript +interface Body { + status: string; + token: string; +} +``` + +### POST `/auth/token` + +Request a authentication token for this API. Only if the username and password match one of the +users registered, a token for authentication will be generated and returned. + +#### Request body + +```typescript +interface Body { + username: string; + password: string; +} +``` + +#### Response body + +```typescript +interface Body { + status: string; + token: string; +} +``` + +### GET `/auth/extend` [requires authentication] + +Request an extension of the token that is used during the request. After successful extension the +new token will be returned in the response body. + +#### Response body + +```typescript +interface Body { + status: string; + token: string; +} +``` + +### PUT `/auth/username` [requires authentication] + +Request a change of the username for the current user. + +#### Request body + +```typescript +interface Body { + username: string; +} +``` + +### PUT `/auth/password` [requires authentication] + +Request a change of the password for the current user. + +#### Request body + +```typescript +interface Body { + password: string; +} +``` diff --git a/docs/api/comments.md b/docs/api/comments.md new file mode 100644 index 0000000000000000000000000000000000000000..1802bce6f23d50777046ea493c692f35c6fcd642 --- /dev/null +++ b/docs/api/comments.md @@ -0,0 +1 @@ +## Comments diff --git a/docs/api/projects.md b/docs/api/projects.md new file mode 100644 index 0000000000000000000000000000000000000000..c05bb3aadbd2b202c5873eb4ada898938afab63a --- /dev/null +++ b/docs/api/projects.md @@ -0,0 +1 @@ +## Projects diff --git a/docs/api/tasks.md b/docs/api/tasks.md new file mode 100644 index 0000000000000000000000000000000000000000..256eeae11c502abf2222f2f98702d4139f099f81 --- /dev/null +++ b/docs/api/tasks.md @@ -0,0 +1 @@ +## Tasks diff --git a/docs/api/teams.md b/docs/api/teams.md new file mode 100644 index 0000000000000000000000000000000000000000..fe195f30aa194ebbe9afa82b1331c04d586c15b7 --- /dev/null +++ b/docs/api/teams.md @@ -0,0 +1 @@ +## Teams diff --git a/docs/api/users.md b/docs/api/users.md new file mode 100644 index 0000000000000000000000000000000000000000..9bfeefc677663cba56ae6a9b3c60302ac45bca1e --- /dev/null +++ b/docs/api/users.md @@ -0,0 +1 @@ +## Users diff --git a/docs/api/work.md b/docs/api/work.md new file mode 100644 index 0000000000000000000000000000000000000000..bc25cb9ada072160c802f77a6d7bba13652d061e --- /dev/null +++ b/docs/api/work.md @@ -0,0 +1 @@ +## Work diff --git a/docs/mockups.md b/docs/mockups.md index b950a0d7308639b1063f675bba71ded764cc715a..b2dda545b2f2b5ce3c550f80f968c64def3b3a8a 100644 --- a/docs/mockups.md +++ b/docs/mockups.md @@ -14,3 +14,4 @@ This document includes some of the mockups created during the design phase of th    +