Repository navigation
API Routes
Isaiah Sinnathamby edited this page Jun 17, 2023
·
5 revisions
The Epic-E-Shop web app uses the following API routes to create a single-page-app-like feel for the user for specific features.
- Method: POST
- URL:
/api/users - Body: Request
{
"username": "string",
"email": "string",
"password": "string",
"vbucks": "int",
"profileImage": "string"
}Response:
{
"id": "int",
"username": "string",
"email": "string",
"vbucks": "int",
"profileImage": "string"
}- Method: POST
- URL:
/api/users/login - Body: Request
{
"username": "string",
"password": "string"
}Response:
{
"id": "int",
"username": "string",
"token": "string"
}- Method: POST
- URL: `/api/users/logout`
- Body: None
Response: None (or HTTP 204 No Content)
- Method: GET
- URL:
/api/session - Body: None
Response:
{
"session": {
"user": {
"id": "int",
"username": "string",
"email": "string",
"vbucks": "int",
"profileImage": "string",
"cart": {
"items": [{
"id": "int",
"productName": "string",
"price": "float",
"quantity": "int"
}]
},
"wishlist": {
"items": [{
"id": "int",
"productName": "string",
"priority": "int"
}]
},
"reminders": {
"items": [{
"id": "int",
"productName": "string",
"reminder_time": "datetime",
"duration": "string"
}]
},
"inventory": {
"items": [{
"id": "int",
"productName": "string"
}]
},
"likes": {
"items": [{
"id": "int",
"productName": "string",
"value": "boolean"
}]
},
"comments": {
"items": [{
"id": "int",
"productName": "string",
"content": "text"
}]
}
}
}
}- Method: GET
- URL:
/api/items - Body: None
Response
{
"items": [
{
"id": "string",
"name": "string",
"price": "string",
"images": {
"icon": "string",
"png": "string",
"featured": "string"
},
"rarity": "string",
"type": "string",
"slug": "string",
"readableType": "string",
"description": "string"
},
]
}- Method: GET
- URL: `/api/items/{itemId}`
- Body: None
Response:
{
"id": "string",
"name": "string",
"price": "string",
"images": {
"icon": "string",
"png": "string",
"featured": "string"
},
"rarity": "string",
"type": "string",
"slug": "string",
"readableType": "string",
"description": "string"
}- Method: POST
- URL: `/api/cart`
- Body Request:
{
"userId": "int",
"itemId": "string",
"quantity": "int"
}Response:
{
"id": "int",
"userId": "int",
"itemId": "string",
"quantity": "int"
}- Method: PUT
- URL: `/api/cart/{cartId}`
- Body Request:
{
"quantity": "int"
}Response:
{
"id": "int",
"userId": "int",
"itemId": "string",
"quantity": "int"
}- Method: DELETE
- URL: `/api/cart/{cartId}`
- Body: None
Response: None (or HTTP 204 No Content)
- Method: POST
- URL:
/api/wishlist - Body: Request
{
"userId": "int",
"itemId": "string",
"priority": "int"
}Response:
{
"id": "int",
"userId": "int",
"itemId": "string",
"priority": "int"
}- Method: PUT
- URL: `/api/wishlist/{wishlistId}`
- Body Request:
{
"priority": "int"
}Response:
{
"id": "int",
"userId": "int",
"itemId": "string",
"priority": "int"
}- Method: DELETE
- URL: `/api/wishlist/{wishlistId}`
- Body: None
Response: None (or HTTP 204 No Content)
- Method: POST
- URL:
/api/reminders - Body: Request
{
"userId": "int",
"itemId": "string",
"reminder_time": "datetime"
}Response:
{
"id": "int",
"userId": "int",
"itemId": "string",
"reminder_time": "datetime"
}- Method: PUT
- URL: `/api/reminders/{reminderId}`
- Body Request:
{
"reminder_time": "datetime"
}Response:
{
"id": "int",
"userId": "int",
"itemId": "string",
"reminder_time": "datetime"
}- Method: DELETE
- URL: `/api/reminders/{reminderId}`
- Body: None
Response: None (or HTTP 204 No Content)
- Method: POST
- URL:
/api/comments - Body: Request
{
"userId": "int",
"itemId": "string",
"content": "text"
}- Method: PUT
- URL: `/api/comments/{commentId}`
- Body Request:
{
"content": "text"
}Response:
{
"id": "int",
"userId": "int",
"itemId": "string",
"content": "text"
}- Method: DELETE
- URL: `/api/comments/{commentId}`
- Body: None
Response: None (or HTTP 204 No Content)
- Method: POST
- URL:
/api/likes - Body: Request
{
"userId": "int",
"itemId": "string",
"value": "boolean"
}Response:
{
"id": "int",
"userId": "int",
"itemId": "string",
"value": "boolean"
}- Method: PUT
- URL: `/api/likes/{likeId}`
- Body Request:
{
"value": "boolean"
}Response:
{
"id": "int",
"userId": "int",
"itemId": "string",
"value": "boolean"
}- Method: DELETE
- URL: `/api/likes/{likeId}`
- Body: None
Response: None (or HTTP 204 No Content)
- Method: GET
- URL:
/api/shop_sections - Body: None Response
[
{
"id": "int",
"displayName": "string",
"key": "string",
"priority": "int"
},
]- Method: GET
- URL: `/api/section_items/{sectionId}`
- Body: None
Response
[
{
"id": "int",
"shop_section_id": "int",
"item_id": "string"
},
]