diff --git a/docs/README.md b/docs/README.md index 4233bd3..db6997a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -13,7 +13,7 @@ The token for this can be aquired using the `/account/authenticate` endpoint. - [X] `/tokens` - [ ] `/follows` - [ ] `/followers` -- `/user/{username}` +- `/user/` - [ ] `/info` - [ ] `/follow` - [ ] `/follows` @@ -21,14 +21,12 @@ The token for this can be aquired using the `/account/authenticate` endpoint. - [ ] `/projects` - `/project` - [ ] `/create` - - `/{projectname}` - - [ ] `/info` - - [ ] `/join` + - [ ] `/info` + - [ ] `/join` ## TODO - Password checking on registration - usage examples - anonymized account deletion reason -- account deactivation - account bound rate limit -- id support for user and project specific calls \ No newline at end of file +- return role in /user/projects \ No newline at end of file diff --git a/docs/account/activate.md b/docs/account/activate.md new file mode 100644 index 0000000..c93c62a --- /dev/null +++ b/docs/account/activate.md @@ -0,0 +1,17 @@ +# `/account/activate` - POST +Activates the account if it was deactivated. + +## HTTP Headers +| Header | Content | +|---------------|--------------------| +| Authorization | `Bearer {token}` | + +## Responses +### 200 - Success +The account was activated. +### 208 - Already Reported +The account is already activated. +### 401 - Error: Unauthorized +The provided auth token doesn't allow you to perform this operation. +### 403 - Error: Forbidden +Blocked for security reasons. \ No newline at end of file diff --git a/docs/user/specific/follow.md b/docs/account/deactivate.md similarity index 64% rename from docs/user/specific/follow.md rename to docs/account/deactivate.md index cab490f..dd929f9 100644 --- a/docs/user/specific/follow.md +++ b/docs/account/deactivate.md @@ -1,5 +1,7 @@ -# `/user/{username}/follow` - POST -Let the authenticated account follow the user. +# `/account/deactivate` - POST +Deactivates the account. +By that the account isn't existing in the public, +until you reactivate it. ## HTTP Headers | Header | Content | @@ -8,12 +10,10 @@ Let the authenticated account follow the user. ## Responses ### 200 - Success -Successfully followed the user. +The account was deactivated. ### 208 - Already Reported -You already follow the user. +The account is already deactivated. ### 401 - Error: Unauthorized The provided auth token doesn't allow you to perform this operation. ### 403 - Error: Forbidden Blocked for security reasons. -### 404 - Error: Not Found -The user wasn't found. \ No newline at end of file diff --git a/docs/project/create.md b/docs/project/create.md index 62fd4fb..310518c 100644 --- a/docs/project/create.md +++ b/docs/project/create.md @@ -19,6 +19,8 @@ __Content - JSON:__ | Field | Description | |-------|---------------------------------| | id | The created projects unique id. | +### 400 - Error: Bad Request +The request was malformed. ### 403 - Error: Forbidden Blocked for security reasons. ### 409 - Error: Conflict diff --git a/docs/project/specific/info.md b/docs/project/info.md similarity index 60% rename from docs/project/specific/info.md rename to docs/project/info.md index 91dd79e..7549965 100644 --- a/docs/project/specific/info.md +++ b/docs/project/info.md @@ -1,6 +1,14 @@ -# `/project/{projectname}/info` - GET +# `/project/info` - GET Returns the list of public projects the user is part of. +## Urlencoded Parameters +You have to set one parameter. +Setting none or two parameters will result in a _400 Bad Request_ Response. +| Parameter | Description | +|-----------|-----------------------------------------------------------------------| +| name | The projectname of the user on which the operation will be performed. | +| id | The projectid of the user on which the operation will be performed. | + ## Responses ### 200 - Success __Content - JSON:__ @@ -11,6 +19,8 @@ __Content - JSON:__ | description | The projects description. | | created | The datetime when the project was created. Represented as UNIX timestamp. | | members | A list of (username, userid) pairs. | +### 400 - Error: Bad Request +The request was malformed. ### 403 - Error: Forbidden Blocked for security reasons. ### 404 - Error: Not Found diff --git a/docs/project/specific/join.md b/docs/project/join.md similarity index 53% rename from docs/project/specific/join.md rename to docs/project/join.md index ea6c7fd..d973fcf 100644 --- a/docs/project/specific/join.md +++ b/docs/project/join.md @@ -1,6 +1,14 @@ -# `/project/{projectname}/join` - POST +# `/project/join` - POST Lets the authenticated account join the project. +## Urlencoded Parameters +You have to set one parameter. +Setting none or two parameters will result in a _400 Bad Request_ Response. +| Parameter | Description | +|-----------|-----------------------------------------------------------------------| +| name | The projectname of the user on which the operation will be performed. | +| id | The projectid of the user on which the operation will be performed. | + ## HTTP Headers | Header | Content | |---------------|--------------------| @@ -17,6 +25,8 @@ Lets the authenticated account join the project. Your request will be reviewed. ### 208 - Already Reported You already joined the project. +### 400 - Error: Bad Request +The request was malformed. ### 403 - Error: Forbidden Blocked for security reasons. ### 404 - Error: Not Found diff --git a/docs/user/follow.md b/docs/user/follow.md new file mode 100644 index 0000000..e8e52eb --- /dev/null +++ b/docs/user/follow.md @@ -0,0 +1,31 @@ +# `/user/follow` - POST +Let the authenticated account follow the user. + + +## Urlencoded Parameters +You have to set one parameter. +Setting none or two parameters will result in a _400 Bad Request_ Response. +| Parameter | Description | +|-----------|--------------------------------------------------------------------| +| name | The username of the user on which the operation will be performed. | +| id | The userid of the user on which the operation will be performed. | + + +## HTTP Headers +| Header | Content | +|---------------|--------------------| +| Authorization | `Bearer {token}` | + +## Responses +### 200 - Success +Successfully followed the user. +### 208 - Already Reported +You already follow the user. +### 400 - Error: Bad Request +The request was malformed. +### 401 - Error: Unauthorized +The provided auth token doesn't allow you to perform this operation. +### 403 - Error: Forbidden +Blocked for security reasons. +### 404 - Error: Not Found +The user wasn't found. \ No newline at end of file diff --git a/docs/user/followers.md b/docs/user/followers.md new file mode 100644 index 0000000..9ea9bda --- /dev/null +++ b/docs/user/followers.md @@ -0,0 +1,25 @@ +# `/user/followers` - GET +Returns the list of accounts following the user. + + +## Urlencoded Parameters +You have to set one parameter. +Setting none or two parameters will result in a _400 Bad Request_ Response. +| Parameter | Description | +|-----------|--------------------------------------------------------------------| +| name | The username of the user on which the operation will be performed. | +| id | The userid of the user on which the operation will be performed. | + + +## Responses +### 200 - Success +__Content - JSON:__ +| Field | Description | +|----------|-------------------------------------| +| accounts | A list of (username, userid) pairs. | +### 400 - Error: Bad Request +The request was malformed. +### 403 - Error: Forbidden +Blocked for security reasons. +### 404 - Error: Not Found +The user wasn't found. \ No newline at end of file diff --git a/docs/user/follows.md b/docs/user/follows.md new file mode 100644 index 0000000..af45c99 --- /dev/null +++ b/docs/user/follows.md @@ -0,0 +1,25 @@ +# `/user/follows` - GET +Returns the list of accounts the user is following. + + +## Urlencoded Parameters +You have to set one parameter. +Setting none or two parameters will result in a _400 Bad Request_ Response. +| Parameter | Description | +|-----------|--------------------------------------------------------------------| +| name | The username of the user on which the operation will be performed. | +| id | The userid of the user on which the operation will be performed. | + + +## Responses +### 200 - Success +__Content - JSON:__ +| Field | Description | +|----------|-------------------------------------| +| accounts | A list of (username, userid) pairs. | +### 400 - Error: Bad Request +The request was malformed. +### 403 - Error: Forbidden +Blocked for security reasons. +### 404 - Error: Not Found +The user wasn't found. \ No newline at end of file diff --git a/docs/user/specific/info.md b/docs/user/info.md similarity index 53% rename from docs/user/specific/info.md rename to docs/user/info.md index 1e80b89..bd4cd64 100644 --- a/docs/user/specific/info.md +++ b/docs/user/info.md @@ -1,6 +1,16 @@ -# `/user/{username}/info` - GET +# `/user/info` - GET Returns information about the project. + +## Urlencoded Parameters +You have to set one parameter. +Setting none or two parameters will result in a _400 Bad Request_ Response. +| Parameter | Description | +|-----------|--------------------------------------------------------------------| +| name | The username of the user on which the operation will be performed. | +| id | The userid of the user on which the operation will be performed. | + + ## Responses ### 200 - Success __Content - JSON:__ @@ -10,6 +20,8 @@ __Content - JSON:__ | name | The users unique username. | | joined | The datetime when the user joined. Represented as UNIX timestamp. | | is_admin | A boolean if the user is an admin. | +### 400 - Error: Bad Request +The request was malformed. ### 403 - Error: Forbidden Blocked for security reasons. ### 404 - Error: Not Found diff --git a/docs/user/projects.md b/docs/user/projects.md new file mode 100644 index 0000000..bf7d642 --- /dev/null +++ b/docs/user/projects.md @@ -0,0 +1,25 @@ +# `/user/projects` - GET +Returns the list of public projects the user is part of. + + +## Urlencoded Parameters +You have to set one parameter. +Setting none or two parameters will result in a _400 Bad Request_ Response. +| Parameter | Description | +|-----------|--------------------------------------------------------------------| +| name | The username of the user on which the operation will be performed. | +| id | The userid of the user on which the operation will be performed. | + + +## Responses +### 200 - Success +__Content - JSON:__ +| Field | Description | +|----------|-------------------------------------------| +| projects | A list of (projectname, projectid) pairs. | +### 400 - Error: Bad Request +The request was malformed. +### 403 - Error: Forbidden +Blocked for security reasons. +### 404 - Error: Not Found +The user wasn't found. \ No newline at end of file diff --git a/docs/user/specific/followers.md b/docs/user/specific/followers.md deleted file mode 100644 index 813a899..0000000 --- a/docs/user/specific/followers.md +++ /dev/null @@ -1,13 +0,0 @@ -# `/user/{username}/followers` - GET -Returns the list of accounts following the user. - -## Responses -### 200 - Success -__Content - JSON:__ -| Field | Description | -|----------|-------------------------------------| -| accounts | A list of (username, userid) pairs. | -### 403 - Error: Forbidden -Blocked for security reasons. -### 404 - Error: Not Found -The user wasn't found. \ No newline at end of file diff --git a/docs/user/specific/follows.md b/docs/user/specific/follows.md deleted file mode 100644 index 41868e7..0000000 --- a/docs/user/specific/follows.md +++ /dev/null @@ -1,13 +0,0 @@ -# `/user/{username}/follows` - GET -Returns the list of accounts the user is following. - -## Responses -### 200 - Success -__Content - JSON:__ -| Field | Description | -|----------|-------------------------------------| -| accounts | A list of (username, userid) pairs. | -### 403 - Error: Forbidden -Blocked for security reasons. -### 404 - Error: Not Found -The user wasn't found. \ No newline at end of file diff --git a/docs/user/specific/projects.md b/docs/user/specific/projects.md deleted file mode 100644 index a614c1b..0000000 --- a/docs/user/specific/projects.md +++ /dev/null @@ -1,13 +0,0 @@ -# `/user/{username}/projects` - GET -Returns the list of public projects the user is part of. - -## Responses -### 200 - Success -__Content - JSON:__ -| Field | Description | -|----------|-------------------------------------------| -| projects | A list of (projectname, projectid) pairs. | -### 403 - Error: Forbidden -Blocked for security reasons. -### 404 - Error: Not Found -The user wasn't found. \ No newline at end of file