Auth API
/auth/users/
(Without authentication token)
Request:
GET
Response 401:
/auth/users/
(Registering a new user)
Request:
POST
Body:
{
"username": "User1",
"password": "MyPassword1234",
"email": "",
"last_name": "",
"first_name": "",
"middle_name": "",
"serial_number": "0000",
"passport": "",
"address": "",
"education_level": "",
"phone_number": "",
"academic_degree": null,
"date_of_birth": null,
"library": null,
"reading_room": null
}
Response 201:
/auth/token/login
(Getting token)
Request:
POST
Body:
Response 200:
/auth/users/
(With authentication token)
Request:
GET
Headers:Authorization: Token 732c303a48cb693fce9282f9716a72e671b9f755
Response 200:
[
{
"id": 9,
"username": "User1",
"email": "",
"last_name": "",
"first_name": "",
"middle_name": "",
"serial_number": "0000",
"passport": "",
"address": "",
"education_level": "",
"phone_number": "",
"academic_degree": null,
"date_of_birth": null,
"library": null,
"reading_room": null,
"readingroombookuser_set": []
}
]
/auth/token/logout
(Invalidating token)
Request:
POST
Body:
Response 200: