'View Profile' Documentation - bounswe/2021SpringGroup7 GitHub Wiki
Description
This API functionality views all the information about a given user. More clearly, it shows the profile page of a user. The function for this endpoint is viewProfile(username), existing in the file profile.py. This functionality utilizes GET requests in our API. Externally, it uses Place Search and Place Details API of Google Maps API.
The URI of the API
If you try this API in our AWS EC2 instance,use
http://ec2-35-158-103-6.eu-central-1.compute.amazonaws.com:5000/api/user/{username}
If you try this API on our local machine, use
http://localhost:5000/api/user/{username}
Note that this functionality works only with GET requests. To test this API, you can use the following valid usernames:
- atainan
- ryan
- merverabia
- onurcanavci
- kadirelmaci
Parameters
Path Parameters
This parameter is specified in the URI route.
username -> username of the user whose information is to be updated -> type: string
Responses
HTTP_200_OK -> User information is retrieved and returned as response successfully. The body of the response contains all the/
information about the user.
HTTP_404_NOT_FOUND -> User with given username does not found in the database.
Successful Response Body
username -> Username of the user -> type: string
first_name -> First name of the user -> type: string
last_name -> Last name of the user -> type: string
email -> Email of the user -> type: string
location -> Location of the user as any string -> type: string
birthday -> Birthday of the user as DD.MM.YYYY -> type: string
isVisible -> Visibility of the profile by other users -> type: string
postIds -> Ids of the posts belonging to the user -> type: integer array
followRequests -> Usernames of the users requesting to follow this user -> type: string array
followers -> Usernames of the users following this user -> type: string array
followings -> Usernames of the users followed by this user -> type: string array
savedPosts -> Ids of the posts saved by this user -> type: integer array
nofRequests -> Number of follow requests made to the user -> type: integer
nofFollowers -> Number of followers of the user -> type: integer
nofFollowings -> Number of followings of the user -> type: integer
posts -> Posts of the user as a list, where each entry is a json object containing all the information
about the post -> type: json object array
coordinates -> Coordinates of the location of the user in the world -> type: json object
locationName -> Formal name of the town where the location of the user exists -> type: string
fullAddress -> Full address of the location of the user -> type: string
formatAddress -> Formatted and shorter version of the address of the location of the user -> type: string