nesh170 / asap-inventory-system

This is a concept inventory system for ECE458. It is built by ASAPsolutions
1 stars 0 forks source link

added the inventory_user system #54

Closed nesh170 closed 7 years ago

nesh170 commented 7 years ago

HTTP Requests: Permissions := IsAdminUser (only admin can GET,POST)

1) GET all users GET /api/user/ HTTP/1.1 Host: localhost:8000 Content-Type: application/json Authorization: Bearer

Example_Response:- { "count": 2, "next": null, "previous": null, "results": [ { "id": 1, "username": "admin", "email": "test@test.com", "is_staff": true, "last_login": "2017-02-02T07:43:29.382006Z", "date_joined": "2017-02-01T04:02:40.863803Z" }, { "id": 2, "username": "ankit", "email": "ak308@duke.edu", "is_staff": false, "last_login": null, "date_joined": "2017-02-02T22:37:19.602451Z" } ] }

2) POST all users POST /api/user/ HTTP/1.1 Host: localhost:8000 Content-Type: application/json Authorization: Bearer

{
  "username": "<username>",
  "password": "<password>",
  "email": "<email>",
  "is_staff": <boolean>
}