|
|
@@ -94,33 +94,13 @@ User{
|
|
|
|
|
|
**Errors:**
|
|
|
|
|
|
-- Invalid email (example: `{"email": "notanemail"}`)
|
|
|
- - Status Code: `422`
|
|
|
+- Invalid `id` URL parameter
|
|
|
+ - Status Code: `400`
|
|
|
- Request Body:
|
|
|
```json
|
|
|
{
|
|
|
- "code":601,
|
|
|
- "errors":["email validation failed"]
|
|
|
- }
|
|
|
- ```
|
|
|
-
|
|
|
-- Missing field
|
|
|
- - Status Code: `422`
|
|
|
- - Request Body:
|
|
|
- ```json
|
|
|
- {
|
|
|
- "code":601,
|
|
|
- "errors":["required validation failed"]
|
|
|
- }`
|
|
|
- ```
|
|
|
-
|
|
|
-- Email already taken
|
|
|
- - Status Code: `422`
|
|
|
- - Request Body:
|
|
|
- ```json
|
|
|
- {
|
|
|
- "code":601,
|
|
|
- "errors":["email already taken"]
|
|
|
+ "code":600,
|
|
|
+ "errors":["could not process request"]
|
|
|
}
|
|
|
```
|
|
|
|
|
|
@@ -149,7 +129,17 @@ User{
|
|
|
}
|
|
|
```
|
|
|
|
|
|
-**Errors:** TBD
|
|
|
+**Errors:**
|
|
|
+
|
|
|
+- Invalid `id` URL parameter
|
|
|
+ - Status Code: `400`
|
|
|
+ - Request Body:
|
|
|
+ ```json
|
|
|
+ {
|
|
|
+ "code":600,
|
|
|
+ "errors":["could not process request"]
|
|
|
+ }
|
|
|
+ ```
|
|
|
|
|
|
#### `GET /api/users/{id}/clusters/all`
|
|
|
|
|
|
@@ -163,7 +153,7 @@ User{
|
|
|
|
|
|
**Request Body**: N/A
|
|
|
|
|
|
-**Response Body**:
|
|
|
+**Successful Response Body**:
|
|
|
|
|
|
```js
|
|
|
{
|
|
|
@@ -176,13 +166,120 @@ User{
|
|
|
}
|
|
|
```
|
|
|
|
|
|
-**Errors:** TBD
|
|
|
+**Errors:**
|
|
|
+
|
|
|
+- Invalid `id` URL parameter
|
|
|
+ - Status Code: `400`
|
|
|
+ - Request Body:
|
|
|
+ ```json
|
|
|
+ {
|
|
|
+ "code":600,
|
|
|
+ "errors":["could not process request"]
|
|
|
+ }
|
|
|
+ ```
|
|
|
|
|
|
-#### `POST /api/users/{id}`
|
|
|
+#### `POST /api/users`
|
|
|
+
|
|
|
+**Description:** Creates a new user with a given email and password.
|
|
|
+
|
|
|
+**URL parameters:**
|
|
|
+
|
|
|
+- `id` The user's ID.
|
|
|
+
|
|
|
+**Query parameters:** N/A
|
|
|
|
|
|
-#### `POST /api/users/{id}/clusters`
|
|
|
+**Request Body**:
|
|
|
+
|
|
|
+```js
|
|
|
+{
|
|
|
+ "email": String,
|
|
|
+ "password": String,
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+**Successful Response Body**: N/A
|
|
|
+
|
|
|
+**Errors:**
|
|
|
+
|
|
|
+- Invalid email (example: `{"email": "notanemail"}`)
|
|
|
+ - Status Code: `422`
|
|
|
+ - Request Body:
|
|
|
+ ```json
|
|
|
+ {
|
|
|
+ "code":601,
|
|
|
+ "errors":["email validation failed"]
|
|
|
+ }
|
|
|
+ ```
|
|
|
+
|
|
|
+- Missing field
|
|
|
+ - Status Code: `422`
|
|
|
+ - Request Body:
|
|
|
+ ```json
|
|
|
+ {
|
|
|
+ "code":601,
|
|
|
+ "errors":["required validation failed"]
|
|
|
+ }`
|
|
|
+ ```
|
|
|
+
|
|
|
+- Email already taken
|
|
|
+ - Status Code: `422`
|
|
|
+ - Request Body:
|
|
|
+ ```json
|
|
|
+ {
|
|
|
+ "code":601,
|
|
|
+ "errors":["email already taken"]
|
|
|
+ }
|
|
|
+ ```
|
|
|
|
|
|
#### `PUT /api/users/{id}`
|
|
|
|
|
|
+**Description:** Updates an existing user
|
|
|
+
|
|
|
+**URL parameters:**
|
|
|
+
|
|
|
+- `id` The user's ID.
|
|
|
+
|
|
|
+**Query parameters:** N/A
|
|
|
+
|
|
|
+**Request body:**
|
|
|
+
|
|
|
+**Successful Response Body**: N/A
|
|
|
+
|
|
|
+**Errors:**
|
|
|
+
|
|
|
+- Invalid `id` URL parameter
|
|
|
+ - Status Code: `400`
|
|
|
+ - Request Body:
|
|
|
+ ```json
|
|
|
+ {
|
|
|
+ "code":600,
|
|
|
+ "errors":["could not process request"]
|
|
|
+ }
|
|
|
+ ```
|
|
|
+
|
|
|
#### `DELETE /api/users/{id}`
|
|
|
|
|
|
+**Description:** Deletes an existing user
|
|
|
+
|
|
|
+**URL parameters:**
|
|
|
+
|
|
|
+- `id` The user's ID.
|
|
|
+
|
|
|
+**Query parameters:** N/A
|
|
|
+
|
|
|
+**Request body:**
|
|
|
+
|
|
|
+**Successful Response Body**: N/A
|
|
|
+
|
|
|
+**Errors:**
|
|
|
+
|
|
|
+- Invalid `id` URL parameter
|
|
|
+ - Status Code: `400`
|
|
|
+ - Request Body:
|
|
|
+ ```json
|
|
|
+ {
|
|
|
+ "code":600,
|
|
|
+ "errors":["could not process request"]
|
|
|
+ }
|
|
|
+ ```
|
|
|
+
|