generated from Real-Dev-Squad/website-template
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#146) API contract for adding a colors property to exisitng users
- Loading branch information
1 parent
fbb6328
commit f287dff
Showing
1 changed file
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Collection - Users | ||
|
||
## API Endpoints | ||
|
||
| Route | Description | | ||
| :---------------------------------------------------------------------------------------: | :--------------------------------------------------------------: | | ||
| [PATCH /migrations/addDefaultColorProperty](#patch-migrations-add_default_color_property) | Adds a colors property all to users, without the colors property | | ||
|
||
## PATCH /migrations/addDefaultColorProperty | ||
|
||
Adds a colors field to every exisiting user. | ||
|
||
- **Params** | ||
None | ||
- **Query** | ||
None | ||
- **Headers** | ||
Content-Type: application/json | ||
- **Cookie** | ||
rds-session: `<JWT>` | ||
- **Success Response:** | ||
|
||
- **Code:** 200 | ||
|
||
- **Content:** | ||
|
||
```json | ||
{ | ||
"message": "String", | ||
"usersDetails": { | ||
"count": Number, | ||
"users": Array<String> | ||
} | ||
|
||
} | ||
``` | ||
|
||
- **Error Response:** | ||
|
||
- **Code:** 401 | ||
|
||
- **Content:** | ||
```json | ||
{ | ||
"statusCode": 401, | ||
"error": "Unauthorized", | ||
"message": "Unauthenticated User." | ||
} | ||
``` | ||
|
||
- **Code:** 500 | ||
- **Content:** | ||
```json | ||
{ | ||
"message": "The server has encountered an unexpected error. Please contact the administrator for more information." | ||
} | ||
``` | ||
|
||
- **Example for updating an existing user documents:** | ||
PATCH /migrations/addDefaultColorProperty<br/> | ||
Content-Type: application/json<br/> | ||
Request-Body:<br/> | ||
None | ||
Response : | ||
Status 200 OK <br/> | ||
Content-Type: application/json<br/> | ||
|
||
```json | ||
{ | ||
"usersDetails": { | ||
"count": 3, | ||
"users": ["ankur_1010", "ankur", "vivek"] | ||
}, | ||
"message": "User colors updated successfully!" | ||
} | ||
``` |