generated from Real-Dev-Squad/website-template
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOC: Added an API contract for arts/:userId (#199)
* added documentation for arts/:userId * fixed one error code
- Loading branch information
1 parent
7e8c043
commit d62809f
Showing
1 changed file
with
62 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,62 @@ | ||
# ARTS | ||
|
||
| Method | Route | Description | | ||
| ------ | ----------------------------------------------- | -------------------------------------------------------------- | | ||
| GET | [/arts/:userId](#get---arts) | It will fetch you the user arts based on id. | | ||
|
||
## Art Object | ||
``` | ||
{ | ||
"id": string, | ||
"css": string, | ||
"price": number, | ||
"title": string, | ||
"userId": string | ||
} | ||
``` | ||
|
||
## **GET /arts/:userId** | ||
|
||
Returns all the art of the user. | ||
|
||
- **Params** | ||
_Required:_ `userId=[string]` | ||
- **Query** | ||
None | ||
- **Body** | ||
None | ||
- **Headers** | ||
Content-Type: application/json | ||
- **Cookie** | ||
rds-session: `<JWT>` | ||
- **Success Response:** | ||
- **Code:** 200 | ||
- **Content:** | ||
|
||
``` | ||
{ | ||
"message": "User Arts of userId <userId> returned successfully", | ||
"arts": [ | ||
{ | ||
"id": string, | ||
"css": string, | ||
"price": number, | ||
"title": string, | ||
"userId": string | ||
} | ||
{ | ||
} | ||
``` | ||
- **Error Response:** | ||
- **Code:** 401 | ||
- **Content:** | ||
`{ 'statusCode': 401, 'error': 'Unauthorized', 'message': 'Unauthenticated User' }` | ||
- **Code:** 204 | ||
- **Content:** | ||
`{}` | ||
- **Code:** 500 | ||
- **Content:** | ||
`{ 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }` | ||