Token (required)
token: YOUR_TOKEN
Status 200
[
{
"id": 1,
"name": "HP",
"image_url": "http://example.com",
"price": "5000000",
"Stock": 5,
"createdAt": "2020-03-12T14:36:23.789Z",
"updatedAt": "2020-03-12T14:36:23.789Z"
}
]
Status 400
{
"name": "SequelizeValidationError && SequelizeUniqueConstraintError",
"message": " err.errors[0].message"
}
Status 403
{
"name": "Access Forbidden",
"message": "wrong password or unprovided token"
}
Status 500
{
msg: "Internal Server Error"
}
Token (required)
token: YOUR_TOKEN
{
name: String
image_url: String,
price: Integer,
stock: Integer
}
Status 201
{
"Message": "Product succesfully created.",
"Data": {
"id": 1,
"name": "HP",
"image_url": "http://example.com",
"price": "4000000",
"Stock": 5
}
}
Status 400
[
{
"message": "Input Cannot Be Empty",
"type": "Validation error",
}
]
Status 403
{
"name": "JsonWebTokenError",
"message": "jwt must be provided"
}
Status 500
{
msg: "Internal Server Error"
}
Token (required)
token: YOUR_TOKEN
Status 200
{
"id": 1,
"name": "HP",
"image_url": "http://example.com",
"price": "3000000",
"Stock": 5,
"createdAt": "2020-03-12T14:36:23.789Z",
"updatedAt": "2020-03-12T14:36:23.789Z"
}
Status 401
{
"name": "JsonWebTokenError",
"message": "invalid token"
}
Status 403
{
"message": "Forbidden access role not admin."
}
Status 403
{
"name": "JsonWebTokenError",
"message": "jwt must be provided"
}
Status 404
{
msg: "Data Not Found"
}
Status 500
{
msg: "Internal Server Error"
}
Token (required)
token: YOUR_TOKEN
{
name: String
image_url: String,
price: Integer,
stock: Integer
}
Status 200
{
"Message": "Products succesfully updated",
"Data": {
"id": 1,
"name": "HP",
"image_url": "http://example.com",
"price": "3000000",
"Stock": 5
}
}
Status 400
[
{
"message": "Input Cannot Be Empty",
"type": "Validation error",
}
]
Status 403
{
"message": "Forbidden access role not admin."
}
Status 403
{
"name": "JsonWebTokenError",
"message": "jwt must be provided"
}
Status 404
{
msg: "Data Not Found"
}
Status 500
{
msg: "Internal Server Error"
}
Token (required)
token: YOUR_TOKEN
Status 200
{
"Message": "Products successfuly deleted",
}
Status 403
{
"name": "JsonWebTokenError",
"message": "jwt must be provided"
}
Status 404
{
msg: "Data Not Found"
}
Status 500
{
msg: "Internal Server Error"
}
{
name: string,
email: string,
password: string,
role: string
}
All Request Body is REQUIRED
Status 201
{
token: "YOUR TOKEN",
newUser: "data new User"
message: "succesfuly registered message"
}
Status 400
[
{
"message": "Input Cannot Be Empty",
"type": "Validation error",
}
]
Status 500
{
msg: "Internal Server Error"
}
{
name: string
role: admin
password: string
}
All Request Body is REQUIRED
Status 200
{
token: "YOUR TOKEN",
message: " succesfuly login message"
}
Status 400
{
"message": "Bad Request"
}
Status 500
{
msg: "Internal Server Error"
}