API Docs
My Individual Server Project is a server application that has several end points and will later be used to hiring partner. This app has :
- RESTful endpoint for asset's CRUD operation
- JSON formatted response
Register before using this web
Request Header
not needed
Request Body
{
"name" : "string",
"email" : "string",
"password" : "string"
}
Response (201 - Created)
{
"id" : "integer",
"email" : "string"
}
Response (400 - Bad Request)
{
"message": "Email is missing"
}
OR
{
"message": "Password is missing"
}
Response (500 - Internal Server)
{
"message": "Internal server error"
}
Get acces token for login
Request Header
not needed
Request Body
{
"email" : "string",
"password" : "string"
}
Response (200 - Ok)
{
"access_token" = "string"
}
Response (400 - Bad Request)
{
"message": "Email is missing"
}
OR
{
"message": "Password is missing"
}
Response (401 - Bad Request)
{
"message": "Invalid email/password"
}
Response (500 - Internal Server)
{
"message": "Internal server error"
}
Get All Teams
Request Header
{
"Authorization": "string"
}
Request Body
not needed
Response (200 - Ok)
[
{
"id": "integer,
"name": "string",
"logo": "string",
"win": "integer",
"draw":"integer",
"lose": "integer",
"goal_average": "integer",
"clean_sheet": "integer",
"failed_to_score": "integer",
"authorId": "integer",
"createdAt": "date",
"updatedAt": "date"
},
...
]
Response (500 - Internal Server)
{
"message": "Internal server error"
}
create new team
Request Header
{
"Authorization": "string"
}
Request Body
{
"id": "integer,
"name": "string",
"logo": "string",
"win": "integer",
"draw":"integer",
"lose": "integer",
"goal_average": "integer",
"clean_sheet": "integer",
"failed_to_score": "integer",
"authorId": "integer",
}
Response (201 - created)
{
"id": "integer,
"name": "string",
"logo": "string",
"win": "integer",
"draw":"integer",
"lose": "integer",
"goal_average": "integer",
"clean_sheet": "integer",
"failed_to_score": "integer",
"authorId": "integer",
"createdAt": "date",
"updatedAt": "date"
}
Response (400 - Bad Request)
{
"message": "Name is required"
}
OR
{
"message": "Win is required"
}
OR
{
"message": "Lose is required"
}
OR
{
"message": "Clean Sheet is required"
}
OR
{
"message": "Average Goal is required"
}
OR
{
"message": "Fail to Score is required"
}
OR
{
"message": "Author Id is required"
}
{
"message": "Win must be a number"
}
OR
{
"message": "Lose must be a number"
}
OR
{
"message": "Clean Sheet must be a number"
}
OR
{
"message": "Average Goal must be a number"
}
OR
{
"message": "Fail to Score must be a number"
}
Response (500 - Internal Server)
{
"message": "Internal server error"
}
Get team by id
Request Header
{
"Authorization": "string"
}
Request Params
{
"id" : "integer"
}
Request Body
not needed
Response (200 - OK)
{
"id": "integer,
"name": "string",
"logo": "string",
"win": "integer",
"draw":"integer",
"lose": "integer",
"goal_average": "integer",
"clean_sheet": "integer",
"failed_to_score": "integer",
"authorId": "integer",
}
Response (404 - Not Found)
{
"message": "Error not found"
}
Response (500 - Internal Server)
{
"message": "Internal server error"
}
Update team by id
Request Header
{
"Authorization": "string"
}
Request Params
{
"id" : "integer"
}
Request Body
{
"id": "integer,
"name": "string",
"logo": "string",
"win": "integer",
"draw":"integer",
"lose": "integer",
"goal_average": "integer",
"clean_sheet": "integer",
"failed_to_score": "integer",
"authorId": "integer",
}
Response (200 - OK)
{
"id": "integer,
"name": "string",
"logo": "string",
"win": "integer",
"draw":"integer",
"lose": "integer",
"goal_average": "integer",
"clean_sheet": "integer",
"failed_to_score": "integer",
"authorId": "integer",
}
Response (400 - Bad Request)
{
"message": "Name is required"
}
OR
{
"message": "Win is required"
}
OR
{
"message": "Lose is required"
}
OR
{
"message": "Clean Sheet is required"
}
OR
{
"message": "Average Goal is required"
}
OR
{
"message": "Fail to Score is required"
}
OR
{
"message": "Author Id is required"
}
{
"message": "Win must be a number"
}
OR
{
"message": "Lose must be a number"
}
OR
{
"message": "Clean Sheet must be a number"
}
OR
{
"message": "Average Goal must be a number"
}
OR
{
"message": "Fail to Score must be a number"
}
Response (404 - Not Found)
{
"message": "Error not found"
}
Response (500 - Internal Server)
{
"message": "Internal server error"
}
Delete team by id
Request Header
{
"Authorization": "string"
}
Request Params
{
"id" : "integer"
}
Request Body
not needed
Response (200 - Ok)
{
"message" : "Team (name of team) succes deleted from list "
}
Response (404 - Not Found)
{
"message": "Error not found"
}
Response (500 - Internal Server)
{
"message": "Internal server error"
}
Update imgUrl using file
Request Header
{
"Authorization": "string"
}
Request Params
not needed
Request Body (multiform/data)
{
midtrans: "string"
}
Response (200 - OK)
{
"message" : "Payment succesfull"
}
Response (400 - Bad Request)
{
"message": "payment failed"
}
Response (500 - Internal Server)
{
"message": "Internal server error"
}