-
Notifications
You must be signed in to change notification settings - Fork 3
API Contract
Validate given credentials and then generate token
-
URL Params
None -
Headers
Content-Type: application/json - Data Params
{
"email": string|required
"password": string|required
}
- Success Response:
-
Code: 200
Content:
{
"access_token": string,
"refresh_token": string,
"scope": string,
"token_type": string,
"expires_in": integer,
"jti": string
}
-
Error Response:
-
Code: 404
Content:{ "message": "user not found", "status": "404" }
OR -
Code: 404
Content:{ "message": "wrong password", "status": "404" }
OR -
Code: 404
Content:{ "message": { "is_enabled": false }, "status": "404" }
-
Code: 404
Creates a new User and returns the new object.
-
URL Params
None -
Headers
Content-Type: application/json - Data Params
{
"username": string|required,
"fullname": string|required,
"password": string|required
}
- Success Response:
-
Code: 200
Content:
{
"data": {<user_object>}
}
-
Error Response:
-
Code: 404
Content:{ "message": "Username sudah ada", "status": "404" }
-
Code: 404
Creates a new User and returns the new object.
-
URL Params
None -
Headers
Content-Type: application/json - Data Params
{
"username": string|required,
}
- Success Response:
-
Code: 200
Content:
{
"data": "Thanks, please check your email for activation.",
"message": "sukses",
"status": "200"
}
-
Error Response:
-
Code: 404
Content:{ "message": "Email not found", "status": "404" }
OR -
Code: 404
Content:{ "message": "No email provided", "status": "404" }
-
Code: 404
Creates a new User and returns the new object.
-
URL Params
Required:otp=[string]
-
Headers
Content-Type: application/json -
Data Params
None - Success Response:
-
Code: 200
Content:
{
"data": "Sukses, Silahkan Melakukan Login",
"message": "sukses",
"status": "200"
}
-
Error Response:
-
Code: 404
Content:{ "message": "OTP tidak ditemukan", "status": "404" }
OR -
Code: 404
Content:{ "message": "Your token is expired. Please Get token again.", "status": "404" }
OR -
Code: 200
Content:
{ "data": "Akun Anda sudah aktif, Silahkan melakukan login", "message": "sukses", "status": "200" }
-
Code: 404
- User object
{
id: string
name: string
username: string
email: string
gender: enum
phone: string
is_active: boolean
image_id: int (FK)
user_otp: int (FK)
created_at: datetime(iso 8601)
updated_at: datetime(iso 8601)
}
Returns all users in the system.
-
URL Params
None -
Data Params
None -
Headers
Content-Type: application/json - Success Response:
-
Code: 200
Content:
{
users: [
{<user_object>},
{<user_object>},
{<user_object>}
]
}
Returns the specified user.
-
URL Params
Required:id=[string]
-
Data Params
None -
Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
-
Code: 200
Content:{ <user_object> }
-
Error Response:
-
Code: 404
Content:{ error : "User doesn't exist" }
OR -
Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
-
Code: 404
Returns all Orders associated with the specified user.
-
URL Params
Required:id=[string]
-
Data Params
None -
Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
-
Code: 200
Content:
{
orders: [
{<order_object>},
{<order_object>},
{<order_object>}
]
}
-
Error Response:
-
Code: 404
Content:{ error : "User doesn't exist" }
OR -
Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
-
Code: 404
Creates a new User and returns the new object.
-
URL Params
None -
Headers
Content-Type: application/json - Data Params
{
name: string
username: string
email: string
password: string
gender: enum
phone: string
}
- Success Response:
-
Code: 200
Content:{ <user_object> }
Updates fields on the specified user and returns the updated object.
-
URL Params
Required:id=[string]
- Data Params
{
name: string
username: string
email: string
password: string
gender: enum
phone: string
}
-
Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
-
Code: 200
Content:{ <user_object> }
-
Error Response:
-
Code: 404
Content:{ error : "User doesn't exist" }
OR -
Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
-
Code: 404
Deletes the specified user.
-
URL Params
Required:id=[string]
-
Data Params
None -
Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
-
Success Response:
- Code: 204
-
Error Response:
-
Code: 404
Content:{ error : "User doesn't exist" }
OR -
Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
-
Code: 404
#Room
- Room object
{
id: string
room_type: enum
rules: string
price_per_daily: decimal
price_per_weekly: decimal
price_per_monthly: decimal
is_available: boolean
facility_id: array[] (FK)
image_id: array[] (FK)
created_at: datetime(iso 8601)
updated_at: datetime(iso 8601)
}
Returns all room in the system.
-
URL Params
None -
Data Params
None -
Headers
Content-Type: application/json - Success Response:
-
Code: 200
Content:
{
room: [
{<room_object>},
{<room_object>},
{<room_object>}
]
}
Returns the specified kos.
-
URL Params
Required:id=[string]
-
Data Params
None -
Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
-
Code: 200
Content:{ <room_object> }
-
Error Response:
-
Code: 404
Content:{ error : "Room doesn't exist" }
OR -
Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
-
Code: 404
Returns all Orders associated with the specified room.
-
URL Params
Required:id=[string]
-
Data Params
None -
Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
-
Code: 200
Content:
{
orders: [
{<room_object>},
{<room_object>},
{<room_object>}
]
}
-
Error Response:
-
Code: 404
Content:{ error : "Room doesn't exist" }
OR -
Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
-
Code: 404
Creates a new Room and returns the new object.
-
URL Params
None - Data Params
{
room_type: enum
rules: string
price_per_daily: decimal
price_per_weekly: decimal
price_per_monthly: decimal
is_available: boolean
facility_id: array[]
image_id: array[]
}
-
Headers
Content-Type: application/json - Success Response:
-
Code: 200
Content:{ <room_object> }
Updates fields on the specified Room and returns the updated object.
-
URL Params
Required:id=[string]
- Data Params
{
room_type: enum
rules: string
price_per_daily: decimal
price_per_weekly: decimal
price_per_monthly: decimal
is_available: boolean
facility_id: array[]
image_id: array[]
}
-
Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
-
Code: 200
Content:{ <room_object> }
-
Error Response:
-
Code: 404
Content:{ error : "Room doesn't exist" }
OR -
Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
-
Code: 404
Deletes the specified product.
-
URL Params
Required:id=[string]
-
Data Params
None -
Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
-
Success Response:
- Code: 204
-
Error Response:
-
Code: 404
Content:{ error : "Room doesn't exist" }
OR -
Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
-
Code: 404
#Kos
- Kos object
{
id: string
name: string
description: string
kos_type: enum
is_available: boolean
owner_id: int (FK)
location_id: int (FK)
room_id: array[] (FK)
created_at: datetime(iso 8601)
updated_at: datetime(iso 8601)
}
Returns all kos in the system.
-
URL Params
None -
Data Params
None -
Headers
Content-Type: application/json - Success Response:
-
Code: 200
Content:
{
kos: [
{<kos_object>},
{<kos_object>},
{<kos_object>}
]
}
Returns the specified kos.
-
URL Params
Required:id=[string]
-
Data Params
None -
Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
-
Code: 200
Content:{ <kos_object> }
-
Error Response:
-
Code: 404
Content:{ error : "Kos doesn't exist" }
OR -
Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
-
Code: 404
Creates a new Kos and returns the new object.
-
URL Params
None - Data Params
{
name: string
description: string
kos_type: enum
is_available: enum
owner_id: int
location_id: int
room_id: array[]
}
-
Headers
Content-Type: application/json - Success Response:
-
Code: 200
Content:{ <kos_object> }
Updates fields on the specified Kos and returns the updated object.
-
URL Params
Required:id=[string]
- Data Params
{
name: string
description: string
kos_type: enum
is_available: enum
owner_id: int
location_id: int
room_id: array[]
}
-
Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
-
Code: 200
Content:{ <kos_object> }
-
Error Response:
-
Code: 404
Content:{ error : "Kos doesn't exist" }
OR -
Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
-
Code: 404
Deletes the specified product.
-
URL Params
Required:id=[string]
-
Data Params
None -
Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
-
Success Response:
- Code: 204
-
Error Response:
-
Code: 404
Content:{ error : "Kos doesn't exist" }
OR -
Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
-
Code: 404
#Orders
- Order object
{
id: string
total: decimal
is_available: boolean
is_paid: boolean
order_detail: [
{<order_detail_object>},
{<order_detail_object>},
{<order_detail_object>},
] (FK)
created_at: datetime(iso 8601)
updated_at: datetime(iso 8601)
}
Returns all orders in the system.
-
URL Params
None -
Data Params
None -
Headers
Content-Type: application/json - Success Response:
-
Code: 200
Content:
{
orders: [
{<order_object>},
{<order_object>},
{<order_object>}
]
}
Returns the specified order.
-
URL Params
Required:id=[string]
-
Data Params
None -
Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
-
Code: 200
Content:{ <order_object> }
-
Error Response:
-
Code: 404
Content:{ error : "Order doesn't exist" }
OR -
Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
-
Code: 404
Returns all room associated with the specified order.
-
URL Params
Required:id=[string]
-
Data Params
None -
Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
-
Code: 200
Content:
{
orders: [
{<room_object>},
{<room_object>},
{<room_object>}
]
}
-
Error Response:
-
Code: 404
Content:{ error : "Order doesn't exist" }
OR -
Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
-
Code: 404
Returns all Users associated with the specified order.
-
URL Params
Required:id=[string]
-
Data Params
None -
Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
-
Success Response:
{ <user_object> }
-
Error Response:
-
Code: 404
Content:{ error : "Order doesn't exist" }
OR -
Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
-
Code: 404
Creates a new Order and returns the new object.
-
URL Params
None - Data Params
{
total: decimal
is_available: boolean
is_paid: boolean
order_detail: [
{<order_detail_object>},
{<order_detail_object>},
{<order_detail_object>},
] (FK)
}
-
Headers
Content-Type: application/json - Success Response:
-
Code: 200
Content:{ <order_object> }
Updates fields on the specified order and returns the updated object.
-
URL Params
Required:id=[string]
- Data Params
{
total: decimal
is_available: boolean
is_paid: boolean
order_detail: [
{<order_detail_object>},
{<order_detail_object>},
{<order_detail_object>},
] (FK)
}
-
Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
-
Code: 200
Content:{ <order_object> }
-
Error Response:
-
Code: 404
Content:{ error : "Order doesn't exist" }
OR -
Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
-
Code: 404
Deletes the specified order.
-
URL Params
Required:id=[string]
-
Data Params
None -
Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
-
Success Response:
- Code: 204
-
Error Response:
-
Code: 404
Content:{ error : "Order doesn't exist" }
OR -
Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
-
Code: 404
#Order Details
- Order Detail object
{
id: integer
note: string
booking_option: enum
amount: array[]
start_date: date
end_date: date
owner_id: string (FK)
occupant_id: string (FK)
kos_id: string (FK)
room_id: [
{<room_object>},
{<room_object>},
{<room_object>},
] (FK)
}
Returns all order details in the system.
-
URL Params
None -
Data Params
None -
Headers
Content-Type: application/json - Success Response:
-
Code: 200
Content:
{
order_detail: [
{<order_detail_object>},
{<order_detail_object>},
{<order_detail_object>}
]
}
Returns the specified order.
-
URL Params
Required:id=[string]
-
Data Params
None -
Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
-
Code: 200
Content:{ <order_object> }
-
Error Response:
-
Code: 404
Content:{ error : "Order detail doesn't exist" }
OR -
Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
-
Code: 404
Returns all room associated with the specified order.
-
URL Params
Required:id=[string]
-
Data Params
None -
Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
-
Code: 200
Content:
{
order_detail: [
{<room_object>},
{<room_object>},
{<room_object>}
]
}
-
Error Response:
-
Code: 404
Content:{ error : "Order detail doesn't exist" }
OR -
Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
-
Code: 404
Creates a new Order Detail and returns the new object.
-
URL Params
None - Data Params
{
note: string
booking_option: enum
amount: array[]
start_date: date
end_date: date
owner_id: string (FK)
occupant_id: string (FK)
kos_id: string (FK)
room_id: [
{<room_object>},
{<room_object>},
{<room_object>},
] (FK)
}
-
Headers
Content-Type: application/json - Success Response:
-
Code: 200
Content:{ <order_detail_object> }
Updates fields on the specified order and returns the updated object.
-
URL Params
Required:id=[string]
- Data Params
{
note: string
booking_option: enum
amount: array[]
start_date: date
end_date: date
owner_id: string (FK)
occupant_id: string (FK)
kos_id: string (FK)
room_id: [
{<room_object>},
{<room_object>},
{<room_object>},
] (FK)
}
-
Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
- Success Response:
-
Code: 200
Content:{ <order__detail_object> }
-
Error Response:
-
Code: 404
Content:{ error : "Order detail doesn't exist" }
OR -
Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
-
Code: 404
Deletes the specified order.
-
URL Params
Required:id=[string]
-
Data Params
None -
Headers
Content-Type: application/json
Authorization: Bearer<OAuth Token>
-
Success Response:
- Code: 204
-
Error Response:
-
Code: 404
Content:{ error : "Order detail doesn't exist" }
OR -
Code: 401
Content:{ error : error : "You are unauthorized to make this request." }
-
Code: 404