This is a internal services which can get meeting room reservations, create reservation, cancel reservation.
- Python
- Django
- Django REST Framework
- Djoser
- Postman
- PostgreSQL
- Docker
Run the project with Docker:
docker-compose up --build
Everything can be checked in Postman and Django Rest Framework. Below are instructions to help test the API in a Postman. First you need to login to get Auth Token with default user:
[email protected]
and password:admin
. From login you will receive "auth_token". This token gives access to every API endpoint.
In your Postman import API endpoint collection fixture file named: Reservations.postman_collection.json
-
Run docker containers
docker-compose up
-
Run pytest inside container
docker exec -it reserv_api_1 /bin/bash -c "pytest"
- Get token from authentication:
- In Postman use this endpoint:
Make POST request and take auth_token from login. Use default credentials email:
http://localhost:8000/api/v1/token/login/
[email protected]
password:admin
- In Postman use this endpoint:
- Check all existing rooms:
- In Postman use this endpoint:
Use "auth_token"in the "Headers -> KEY: Authorization -> VALUE: Token {{ token }}" Make GET request and check all existing rooms
http://localhost:8000/api/v1/rooms/all/
- In Postman use this endpoint:
- Check all existing reservations:
- In Postman use this endpoint:
Use "auth_token"in the "Headers -> KEY: Authorization -> VALUE: Token {{ token }}" Make GET request and check all existing reservations
http://localhost:8000/api/v1/reservations/all/
- In Postman use this endpoint:
- Get meeting room reservations:
- In Postman use this endpoint:
Use "auth_token"in the "Headers -> KEY: Authorization -> VALUE: Token {{ token }}" Make GET request and check meeting room reservations
http://localhost:8000/api/v1/reservations/room/1/
- In Postman use this endpoint:
- Create reservation:
- In Postman use this endpoint:
Use "auth_token"in the "Headers -> KEY: Authorization -> VALUE: Token {{ token }}" Make POST request and create reservation
http://localhost:8000/api/v1/create/reservation/
- Body example in Postman collection
- In Postman use this endpoint:
- Cancel reservation
- In Postman use this endpoint:
Use "auth_token"in the "Headers -> KEY: Authorization -> VALUE: Token {{ token }}" Make DELETE request and delete reservation by id
http://localhost:8000/api/v1/reservation/delete/1/
- In Postman use this endpoint:
- Logout and destroy token
- In Postman use this endpoint:
Use "auth_token"in the "Headers -> KEY: Authorization -> VALUE: Token {{token}}" Make POST request and logout
http://localhost:8000/api/v1/token/logout/
- In Postman use this endpoint:
Created by @enrika - feel free to contact me!