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