Request :
- Method : POST
- Endpoint :
/api/auth/v1
- Header :
- Content-Type: application/json
- Accept: application/json
- Body :
{
"nim" : "string",
"email" : "string",
"username" : "string",
"password" : "string"
}
Response :
{
"status" : "number"
}
Request :
- Method : POST
- Endpoint :
/api/auth/v2
- Header :
- Content-Type: application/json
- Accept: application/json
- Body :
{
"nim" : "string",
"password" : "string"
}
Response :
{
"status" : "number",
"data" : {
"token" : "string",
"user" : {
"username" : "string",
"admin" : boolean
}
}
}
Request :
- Method : POST
- Endpoint :
/api/books
- Header :
- Content-Type: application/json
- Accept: application/json
- Query Param :
- size : number,
- page : number,
- sort : string,
- search : string
- Body :
{
"categories" : [
{
"id" : "string, unique",
"category" : "string"
},
{
"id" : "string, unique",
"category" : "string"
}
]
}
Response :
{
"status" : "number",
"data" : [
{
"id" : "string, unique",
"title" : "string",
"synopsis" : "string",
"stock" : "number",
"author" : "string",
"image_url" : "string",
"createdAt" : "datetime",
"updatedAt" : "datetime",
"categories" : [
{
"id" : "string, unique",
"category" : "string"
},
{
"id" : "string, unique",
"category" : "string"
}
]
},
{
"id" : "string, unique",
"title" : "string",
"synopsis" : "string",
"stock" : "number",
"author" : "string",
"image_url" : "string",
"createdAt" : "datetime",
"updatedAt" : "datetime",
"categories" : [
{
"id" : "string, unique",
"category" : "string"
}
]
}
]
}
Request :
- Method : GET
- Endpoint :
/api/books
- Header :
- Accept: application/json
- Query Param :
- size : number,
- page : number
Response :
{
"status" : "number",
"data" : [
{
"id" : "string, unique",
"title" : "string",
"synopsis" : "string",
"stock" : "number",
"author" : "string",
"image_url" : "string",
"createdAt" : "datetime",
"updatedAt" : "datetime",
"categories" : [
{
"id" : "string, unique",
"category" : "string"
},
{
"id" : "string, unique",
"category" : "string"
}
]
},
{
"id" : "string, unique",
"title" : "string",
"synopsis" : "string",
"stock" : "number",
"author" : "string",
"image_url" : "string",
"createdAt" : "datetime",
"updatedAt" : "datetime",
"categories" : [
{
"id" : "string, unique",
"category" : "string"
}
]
}
]
}
Request :
- Method : GET
- Endpoint :
/api/books/:book_id
- Header :
- Accept: application/json
- Authorization : Bearer your_token
Response :
{
"status" : "number",
"data" : {
"id" : "string, unique",
"title" : "string",
"synopsis" : "string",
"stock" : "number",
"author" : "string",
"image_url" : "string",
"createdAt" : "datetime",
"updatedAt" : "datetime",
"categories" : [
{
"id" : "string, unique",
"category" : "string"
},
{
"id" : "string, unique",
"category" : "string"
}
]
}
}
Request :
- Method : POST
- Endpoint :
/api/carts/:book_id
- Header :
- Accept: application/json
- Authorization : Bearer your_token
Response :
{
"status" : "number"
}
Request :
- Method : DELETE
- Endpoint :
/api/carts/:book_id
- Header :
- Accept: application/json
- Authorization : Bearer your_token
Response :
{
"status" : "number"
}
Request :
- Method : POST
- Endpoint :
/api/loans/:book_id
- Header :
- Accept: application/json
- Authorization : Bearer your_token
Response :
{
"status" : "number"
}
Request :
- Method : PATCH
- Endpoint :
/api/loans/:loan_id
- Header :
- Accept: application/json
- Authorization : Bearer your_token
Response :
{
"status" : "number"
}
Request :
- Method : GET
- Endpoint :
/api/loans
- Header :
- Accept: application/json
- Authorization : Bearer your_token
Response :
{
"status" : "number",
"data" : [
{
"id" : "string, unique",
"loan_time" : "datetime",
"return" : boolean,
"book" : {
"id" : "string, unique",
"title" : "string",
"synopsis" : "string",
"stock" : "number",
"author" : "string",
"image_url" : "string",
"createdAt" : "datetime",
"updatedAt" : "datetime",
"categories" : [
{
"id" : "string, unique",
"category" : "string"
},
{
"id" : "string, unique",
"category" : "string"
}
]
}
},
{
"id" : "string, unique",
"loan_time" : "datetime",
"return" : boolean,
"book" : {
"id" : "string, unique",
"title" : "string",
"synopsis" : "string",
"stock" : "number",
"author" : "string",
"image_url" : "string",
"createdAt" : "datetime",
"updatedAt" : "datetime",
"categories" : [
{
"id" : "string, unique",
"category" : "string"
}
]
}
}
]
}
Request :
-
Method : POST
-
Endpoint :
/api/categories/
-
Header :
- Content-Type: application/json
- Accept: application/json
- Authorization : Bearer your_token
-
Body :
{
"category" : "string",
}
Response :
{
"status" : "number"
}
Request :
-
Method : PATCH
-
Endpoint :
/api/categories/:category_id
-
Header :
- Content-Type: application/json
- Accept: application/json
- Authorization : Bearer your_token
-
Body :
{
"category" : "string",
}
Response :
{
"status" : "number"
}
Request :
- Method : DELETE
- Endpoint :
/api/categories/:category_id
- Header :
- Accept: application/json
- Authorization : Bearer your_token
Response :
{
"status" : "number"
}
Request :
-
Method : POST
-
Endpoint :
/api/books/
-
Header :
- Content-Type: application/json
- Accept: application/json
- Authorization : Bearer your_token
-
Body :
{
"title" : "string",
"synopsis" : "string",
"stock" : "number",
"author" : "string",
"image_url" : "string",
"categories" : [
{
"id" : "string, unique",
"category" : "string"
},
{
"id" : "string, unique",
"category" : "string"
}
]
}
Response :
{
"status" : "number"
}
Request :
-
Method : PATCH
-
Endpoint :
/api/categories/:book_id
-
Header :
- Content-Type: application/json
- Accept: application/json
- Authorization : Bearer your_token
-
Body :
{
"title" : "string",
"synopsis" : "string",
"stock" : "number",
"author" : "string",
"image_url" : "string",
"categories" : [
{
"id" : "string, unique",
"category" : "string"
}
]
}
Response :
{
"status" : "number"
}
Request :
- Method : DELETE
- Endpoint :
/api/categories/:book_id
- Header :
- Accept: application/json
- Authorization : Bearer your_token
Response :
{
"status" : "number"
}
Request :
- Method : GET
- Endpoint :
/api/loans
- Header :
- Accept: application/json
- Authorization : Bearer your_token
Response :
{
"status" : "number",
"data" : [
{
"id" : "string, unique",
"loan_time" : "datetime",
"return" : boolean,
"book" : {
"id" : "string, unique","string, unique"
"title" : "string",
"synopsis" : "string",
"stock" : "number",
"author" : "string",
"image_url" : "string",
"createdAt" : "datetime",
"updatedAt" : "datetime",
"categories" : [
{
"id" : "string, unique",
"category" : "string"
},
{
"id" : "string, unique",
"category" : "string"
}
]
},
"user": {
"id" : "string, unique",
"nim" : "string",
"username" : "string",
}
},
{
"id" : "string, unique",
"loan_time" : "datetime",
"return" : boolean,
"book" : {
"id" : "string, unique",
"title" : "string",
"synopsis" : "string",
"stock" : "number",
"author" : "string",
"image_url" : "string",
"createdAt" : "datetime",
"updatedAt" : "datetime",
"categories" : [
{
"id" : "string, unique",
"category" : "string"
}
]
},
"user": {
"id" : "string, unique",
"nim" : "string",
"username" : "string",
}
}
]
}
Request :
- Method : GET
- Endpoint :
/api/auth
- Header :
- Accept: application/json
- Authorization : Bearer your_token
Response :
{
"status" : "number",
"data": {
"user": {
"username" : "string",
"admin" : boolean
},
"there_is_loan_limit" : "true"
}
}
Request :
- Method : POST
- Endpoint :
/api/auth/v3
- Header :
- Accept: application/json
- Authorization : Bearer your_token
Response :
{
"status" : "number"
}