Closed nesh170 closed 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> }
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