User Profile - MarcoLagalla/marette_backend GitHub Wiki
Name | User Profile |
---|---|
Description | Display user profile |
URL | api/v1/account/profile/<int:id> |
Allowed methods | GET |
Authorizations | GET (IsAdmin, IsOwner) |
Needs HTTP GET Authorization Token Header, like:
Authorization: Token 44d18cb0c6568336ba2dab512f5abfed319a1ef1
Parameter | Type | Description |
---|---|---|
id |
int | valid user id |
Returns the complete details list for the user profile that matches this token. So only the owner of the profile, or an admin, can retrieve the details.
User Example
{
"user": 77,
"username": "user1",
"email": "[email protected]",
"first_name": "",
"last_name": "",
"birth_date": "",
"phone": "+393457623743",
"is_superuser": false,
"email_activated" : true
}
Business User Example
{
"user": 77,
"username": "user1",
"email": "[email protected]",
"first_name": "",
"last_name": "",
"birth_date": "",
"phone": "+393457623743",
"is_superuser": false,
"email_activated" : true,
....
"n_civ":"10"
"restaurants" : [1,2,3] <-- restaurant's ids
}
Status | Description |
---|---|
HTTP_200_OK |
return user profile |
HTTP_404_NOT_FOUND |
user not found |
HTTP_401_UNAUTHORIZED |
user not authorized |