This API service is hosted live on the endpoint https://usersappudbhav.herokuapp.com
An example app using this API endpoint is hosted on https://users-app-frontend.vercel.app and the source code for this app can be found on https://github.com/Udbhav8/usersAppFrontend
https://usersappudbhav.herokuapp.com
https://users-app-frontend.vercel.app
pip install -r requirements.txt
python manage.py makemigrations
python manage.py migrate
python manage.py runserver
The REST API to the example app is described below.
GET /users/
curl -X GET http://127.0.0.1:8000/users
POST /users/
curl -X POST -H "Content-Type: application/json" http://127.0.0.1:8000/users/ -d "{\"firstName\":\"Udbhav\",\"lastName\":\"Agarwal\",\"email\":\"[email protected]\",\"role\":\"Regular\",\"number\":\"250-891-8441\"}"
{"message": "New User Udbhav Agarwal with email:[email protected] created successfully"}
GET /user/id
curl -X GET http://127.0.0.1:8000/user/1
{"id":"1", "firstName": "Udbhav", "lastName": "Agarwal", "email": "[email protected]", "role":"Regular"}
PATCH /update-user/id
curl -X PATCH -H "Content-Type: application/json" http://127.0.0.1:8000/update-user/1 -d "{\"firstName\":\"Udbhav\",\"lastName\":\"agarwal\",\"email\":\"[email protected]\",\"role\":\"Regular\",\"number\":\"250-891-8441\"}"
{'message':"User Udbhav Agarwal with email:[email protected] updated successfully"}
DELETE /update-user/id
curl -X DELETE http://127.0.0.1:8000/update-user/1
{'message':"User Udbhav Agarwal with email:[email protected] deleted successfully"}