Skip to content

Commit

Permalink
DOC: Added an API contract for arts/:userId (#199)
Browse files Browse the repository at this point in the history
* added documentation for arts/:userId

* fixed one error code
  • Loading branch information
vikasosmium authored Nov 18, 2024
1 parent 7e8c043 commit d62809f
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions arts/README.md
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' }`

0 comments on commit d62809f

Please sign in to comment.