Skip to content

Commit d62809f

Browse files
authored
DOC: Added an API contract for arts/:userId (#199)
* added documentation for arts/:userId * fixed one error code
1 parent 7e8c043 commit d62809f

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

arts/README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# ARTS
2+
3+
| Method | Route | Description |
4+
| ------ | ----------------------------------------------- | -------------------------------------------------------------- |
5+
| GET | [/arts/:userId](#get---arts) | It will fetch you the user arts based on id. |
6+
7+
## Art Object
8+
```
9+
{
10+
"id": string,
11+
"css": string,
12+
"price": number,
13+
"title": string,
14+
"userId": string
15+
}
16+
```
17+
18+
## **GET /arts/:userId**
19+
20+
Returns all the art of the user.
21+
22+
- **Params**
23+
_Required:_ `userId=[string]`
24+
- **Query**
25+
None
26+
- **Body**
27+
None
28+
- **Headers**
29+
Content-Type: application/json
30+
- **Cookie**
31+
rds-session: `<JWT>`
32+
- **Success Response:**
33+
- **Code:** 200
34+
- **Content:**
35+
36+
```
37+
38+
{
39+
"message": "User Arts of userId <userId> returned successfully",
40+
"arts": [
41+
{
42+
"id": string,
43+
"css": string,
44+
"price": number,
45+
"title": string,
46+
"userId": string
47+
}
48+
{
49+
}
50+
```
51+
52+
- **Error Response:**
53+
- **Code:** 401
54+
- **Content:**
55+
`{ 'statusCode': 401, 'error': 'Unauthorized', 'message': 'Unauthenticated User' }`
56+
- **Code:** 204
57+
- **Content:**
58+
`{}`
59+
- **Code:** 500
60+
- **Content:**
61+
`{ 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }`
62+

0 commit comments

Comments
 (0)