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