Request :
- Method : POST
- Endpoint :
/api/products
- Header :
- Content-Type: application/json
- Accept: application/json
- Body :
{
"id": "integer, unique",
"name": "string",
"price": "double",
"quantity": "integer"
}
Response :
{
"code": "number",
"status": "string",
"data": {
"id": "integer, unique",
"name": "string",
"price": "double",
"quantity": "integer",
"createdAt": "date"
}
}
Request :
- Method : GET
- Endpoint :
/api/products/{id}
- Header :
- Content-Type: application/json
Response :
{
"code": "number",
"status": "string",
"data": {
"id": "integer, unique",
"name": "string",
"price": "double",
"quantity": "integer",
"createdAt": "date"
}
}
Request :
- Method : PUT
- Endpoint :
/api/products/{id}
- Header :
- Content-Type: application/json
- Accept: application/json
- Body :
{
"name": "string",
"price": "long",
"quantity": "integer"
}
Response :
{
"code": "number",
"status": "string",
"data": {
"id": "int, unique",
"name": "string",
"price": "double",
"quantity": "integer",
"createdAt": "date",
"updatedAt": "date"
}
}
Request :
- Method : PUT
- Endpoint : /api/products
- Header :
- Accept: application/json
- Body :
Response :
{
"code": "number",
"status": "string",
"data": [
{
"id": "integer, unique",
"name": "string",
"price": "double",
"quantity": "integer",
"createdAt": "date",
"updatedAt": "date"
},
{
"id": "integer, unique",
"name": "string",
"price": "double",
"quantity": "integer",
"createdAt": "date",
"updatedAt": "date"
}
]
}
Request:
- Method: DELETE
- Endpoint:
/api/products/{id}
- Header:
- Accept:application/json
{
"code": "number",
"status": "string"
}