Flotski RESTful API - nonironman/flotski GitHub Wiki
-
URL
/login
-
Methods
`POST` login
Request example
{ "username": "user", "password": "pass" }
Response examples
200
403
{ "code": 403, "message": "ACCESS_FORBIDDEN" }
-
URL
/logout
-
Methods
`POST` logout
Request example
{ "username": "user", "password": "pass" }
Response examples
200
403
{ "code": 403, "message": "ACCESS_FORBIDDEN" }
-
URL
/users/:id
-
Methods
`GET`
Get specified user info
Response examples:
200
{ "id": "user_id", "username": "user", "description": "user description" }
-
404
- user not found
{ "code": 404, "message": "USER_NOT_FOUND" }
-
503
- Internal server error
{ "code": 503, "message": "INTERNAL_SERVER_ERROR" }
`POST`
Create new user
Request example (application/json):
{ "username": "user", "password": "pass", "description": "?????" }
Response examples:
-
201
- created{ "username": "user", "description": "???" }
-
409
- user already exist{ "code": 409, "message": "USER_EXIST" }
-
400
Bad request{ "code": 400, "message": "JSON_PARSE_ERROR" }
-
403
- user not found{ "code": 403, "message": "ACCESS_FORBIDDEN" }
-
503
Server error{ "code": 503, "message": "INTERNAL_SERVER_ERROR" }
`PUT`
Update existing user by id
Request example (application/json):
{ "username": "user", "description": "description" }
Response examples:
-
200
- user updated{ "id": "user_id", "username": "user", "description": "user_description" }
-
404
- user not found{ "code": 404, "message": "USER_NOT_FOUND" }
-
403
- user not found{ "code": 403, "message": "ACCESS_FORBIDDEN" }
-
503
- Internal Server Error{ "code": 503, "message": "INTERNAL_SERVER_ERROR" }
`DELETE`
DELETE user by id
Response examples:
-
200
- user deleted -
404
- user not found{ "code": 404, "message": "USER_NOT_FOUND" }
-
403
- user not found{ "code": 403, "message": "ACCESS_FORBIDDEN" }
-
503
- Internal Server Error{ "code": 503, "message": "INTERNAL_SERVER_ERROR" }
-
URL
/privileges
TODO
-
URL
/rooms/:id
-
Methods
`GET`
Return specified room info
`POST`
Create new room ????
`PUT`
Update existing room
`DELETE`
Delete existing room ???
-
URL
/book/:id
-
Methods
`GET`
Return specified booking info
`POST`
Create new booking
`PUT`
Update existing booking
`DELETE`
Delete existing booking
-
URL
/guest/:id
-
Methods
`GET`
Return specified guest info
`POST`
Create new guest
`PUT`
Update existing guest
`DELETE`
Delete existing guest