We use Django Rest Framework's Token Authentication. To send authenticated request, include something like
Authorization: Token 5d16226988e80e8e8d4a3b595585f0da148549d2
in the HTTP header.
-
/users/register-
POSTRequired fields: username, password, email, org
Other fields: email
Authorization: no
Success:
201 Created
-
-
/users/update/<str username>-
GETAuthorization: yes
Success:
200 OKReturn values: user object
-
PUTRequired fields: username, password, email, org
Authorization: yes
Success:
200 OKReturn values: (updated) user object
-
PATCHAuthorization: yes
Success:
200 OKReturn values: (updated) user object
-
DELETEAuthorization: yes
Success:
204 No Content
-
-
/users/login-
POSTRequired fields: username, password
Authorization: no
Success:
200 OKReturn values: token
-
-
/users/logout-
POSTAuthorization: yes
Success:
200 OK
-
-
/users/pickup-locations-
GETAuthorization: yes
Success:
200 OKReturn values: list of pickup location objects
-
-
/users/organizations-
GETAuthorization: no
Success:
200 OKReturn values: list of organization objects
-
-
/lostandfound/add-item-
POSTRequired fields: is_lost, image
Authorization: yes
Success: 201 CREATED
-
-
/lostandfound/update-item-
POSTRequired fields: id
Authorization: yes
Success: 200 OK
-
-
/lostandfound/delete-items-
GETRequired fields: id
Authorization: yes
Success: 204 NO CONTENT
-
-
/lostandfound/get-lost-items-
GETAuthorization: yes
Success:
200 OKReturn values: a list of lost items and a list of lost item images associated with the request user
-
-
/lostandfound/get-found-items-
GETAuthorization: yes
Success:
200 OKReturn values: a list of found items and a list of found item images associated with the request user
-