All API must use this authentication
Request :
- Header :
- Bearer Token : "your token"
Request :
- Method : POST
- Endpoint :
/api/student
- Header :
- Content-Type: application/json
- Accept: application/json
- Body :
{
"nama" : "string",
"alamat" : "string",
"no_telepon" : "integer"
}
Response :
{
"message" : "string",
"data" : {
"id" : "integer, unique",
"nama" : "string",
"alamat" : "string",
"no_telepon" : "integer",
"createdAt" : "datetime",
"updatedAt" : "datetime"
}
}
Request :
- Method : GET
- Endpoint :
/api/student/{student_id}
- Header :
- Accept: application/json
Response :
{
"message" : "string",
"data" : {
"id" : "integer, unique",
"nama" : "string",
"alamat" : "string",
"no_telepon" : "integer",
"createdAt" : "datetime",
"updatedAt" : "datetime"
}
}
Request :
- Method : PUT
- Endpoint :
/api/products/{student_id}
- Header :
- Content-Type: application/json
- Accept: application/json
- Body :
{
"nama" : "string",
"alamat" : "string",
"no_telepon" : "integer"
}
Response :
{
"message" : "string",
"data" : {
"id" : "integer, unique",
"nama" : "string",
"alamat" : "string",
"no_telepon" : "integer",
"createdAt" : "datetime",
"updatedAt" : "datetime"
}
}
Request :
- Method : GET
- Endpoint :
/api/student
- Header :
- Accept: application/json
Response :
{
"message" : "string",
"data" : [
{
"id" : "id, unique",
"nama" : "string",
"alamat" : "string",
"no_telepon" : "integer",
"createdAt" : "datetime",
"updatedAt" : "datetime"
},
{
"id" : "id, unique",
"nama" : "string",
"alamat" : "string",
"no_telepon" : "integer",
"createdAt" : "datetime",
"updatedAt" : "datetime"
}
]
}
Request :
- Method : DELETE
- Endpoint :
/api/student/{student_id}
- Header :
- Accept: application/json
Response :
{
"message" : "string"
}